I wanted play around with mongo-client by Raynos. However, when I add "mongo-client" : "0.2.1"
to my package.json
dependencies, I get the following:
(node-gyp rebuild 2> builderror.log) || (exit 0)
CXX(target) Release/obj.target/bson/ext/bson.o
SOLINK_MODULE(target) Release/bson.node
SOLINK_MODULE(target) Release/bson.node: Finished
The builderror log
is empty. And if I run npm install
again, I get a lot of unmet dependencies
, such as:
npm WARN unmet dependency /node_modules/mongo-client requires reducible@'Raynos/reducible#v1.0.6' but will load
npm WARN unmet dependency /node_modules/reducible,
Now, I haven't encountered an error like this before. There are no reported issues on GIT with mongo-client
. So, I want to know at a high-level what is going on and how to interpret the error?
Of course, I googled too. I'm thinking this might fix it:
https://github.com/TooTallNate/node-gyp/wiki/Updating-npm's-bundled-node-gyp
but when I run:
$ sudo npm explore npm -g -- npm install node-gyp
I get TypeError: Bad argument
Any insight and guidance on next steps appreciated.
Thank you.
The binding.gyp file describes the configuration to build your module, in a JSON-like format. This file gets placed in the root of your package, alongside package.
Some node modules use node-pre-gyp to download pre-compiled binaries. By default, node-pre-gyp will try to download those binaries from an external resource, like github. This tutorial will leverage the functionality of node-pre-gyp to download binaries from a mirror.
I get the same messages when installing mongo-client
as well, but they are warnings and not errors, so npm
continues.
The warnings are related to some custom dependencies (see here) for mongo-client
, which cannot be resolved by npm
. However, it tries to do the right thing by installing non-custom versions of those dependencies instead (and tells you about it with a warning).
It might, or might not, work after installing. I got as far as running require('mongo-client')
which didn't raise any errors, but it might still run into problems when actually in use.
Perhaps the author of mongo-client
has a reason to include these custom dependencies, but they really should be either included as part of his own module, or he should have used a proper location (like a Github repository) from which npm
can install them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With