errros installing mongo client with NPM

45 views
Skip to first unread message

ad...@cs.miami.edu

unread,
Oct 6, 2016, 10:41:41 AM10/6/16
to nodejs
Hi Node users,

Very new to node.js, I am trying to use node with mongo, but getting NPM errors when installing mongodb.

I am using ubuntu 12.04. I installed node using ubunut apt-get.  Node version is v0.6.12 according to node --version.

npm install mongodb  :

npm http GET http://registry.npmjs.org/mongodb
npm http 304 http://registry.npmjs.org/mongodb
npm http GET http://registry.npmjs.org/mongodb-core/1.2.31
npm http GET http://registry.npmjs.org/readable-stream/1.0.31
npm http GET http://registry.npmjs.org/es6-promise/3.0.2
npm http 304 http://registry.npmjs.org/mongodb-core/1.2.31
npm http 304 http://registry.npmjs.org/readable-stream/1.0.31
npm http 304 http://registry.npmjs.org/es6-promise/3.0.2
npm http GET http://registry.npmjs.org/core-util-is
npm http GET http://registry.npmjs.org/isarray/0.0.1
npm http GET http://registry.npmjs.org/string_decoder
npm http GET http://registry.npmjs.org/inherits
npm http 304 http://registry.npmjs.org/core-util-is
npm http 304 http://registry.npmjs.org/isarray/0.0.1
npm http 304 http://registry.npmjs.org/string_decoder
npm http 304 http://registry.npmjs.org/inherits
npm http GET http://registry.npmjs.org/bson
npm http 304 http://registry.npmjs.org/bson
npm ERR! error installing mongod...@1.2.31
npm ERR! error installing mon...@2.1.3

npm ERR! Error: No compatible version found: bson@'>=0.4.20- <0.5.0-'
npm ERR! Valid install targets:
npm ERR! ["0.0.1","0.0.2","0.0.3","0.0.4","0.0.5","0.0.6","0.0.7","0.0.8","0.0.9","0.1.0","0.1.1","0.1.3","0.1.4","0.1.5","0.1.6","0.1.7"]
npm ERR!     at installTargetsError (/usr/share/npm/lib/cache.js:488:10)
npm ERR!     at next_ (/usr/share/npm/lib/cache.js:438:17)
npm ERR!     at next (/usr/share/npm/lib/cache.js:415:44)
npm ERR!     at /usr/share/npm/lib/cache.js:408:5
npm ERR!     at saved (/usr/share/npm/lib/utils/npm-registry-client/get.js:147:7)
npm ERR!     at Object.oncomplete (/usr/lib/nodejs/graceful-fs.js:230:7)
npm ERR! You may report this log at:
npm ERR!     <http://bugs.debian.org/npm>
npm ERR! or use
npm ERR!     reportbug --attach /home/adam/node_modules/npm-debug.log npm
npm ERR!
npm ERR! System Linux 3.13.0-93-generic
npm ERR! command "node" "/usr/bin/npm" "install" "mongodb"
npm ERR! cwd /home/adam/node_modules
npm ERR! node -v v0.6.12
npm ERR! npm -v 1.1.4
npm ERR! message No compatible version found: bson@'>=0.4.20- <0.5.0-'
npm ERR! message Valid install targets:
npm ERR! message ["0.0.1","0.0.2","0.0.3","0.0.4","0.0.5","0.0.6","0.0.7","0.0.8","0.0.9","0.1.0","0.1.1","0.1.3","0.1.4","0.1.5","0.1.6","0.1.7"]
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /home/adam/node_modules/npm-debug.log
npm not ok

Any help would be great!

-Adam


Michael Macherey

unread,
Oct 8, 2016, 2:06:05 AM10/8/16
to nodejs
Alternatively to "Installing Node.js via package manager" there is Node Version Manager(NVM)

David Ko

unread,
Oct 8, 2016, 2:06:15 AM10/8/16
to nodejs
Hey Adam,
Just out of curiosity, is there a reason that you're using such an old version of nodejs?

v0.6.12 is from 4 years ago and it may be contributing to the problems you're having.

-David

Ryan Schmidt

unread,
Oct 8, 2016, 2:06:27 AM10/8/16
to nod...@googlegroups.com

> On Oct 5, 2016, at 10:31 AM, ad...@cs.miami.edu wrote:
>
> Hi Node users,
>
> Very new to node.js, I am trying to use node with mongo, but getting NPM errors when installing mongodb.
>
> I am using ubuntu 12.04. I installed node using ubunut apt-get. Node version is v0.6.12 according to node --version.
>

> npm ERR! node -v v0.6.12
> npm ERR! npm -v 1.1.4

node 0.6.12 is ancient (from March 2012). npm 1.1.4 is similarly ancient.

The current version of node is 6.7.0 and includes npm 3.10.3. Please upgrade.

ad...@cs.miami.edu

unread,
Oct 8, 2016, 2:06:38 AM10/8/16
to nodejs
Never mind I got it to work fine by not using apt get and just downloading latest binaries for node and npm. Now mongo module installs fine with npm

ad...@cs.miami.edu

unread,
Oct 9, 2016, 1:56:26 AM10/9/16
to nodejs
If anyone else runs into the same problem I did above, the easy solution is to NOT use apt-get install to install node.js, just download the latest stable binary for your distro and go from there.

-Adam


On Thursday, October 6, 2016 at 10:41:41 AM UTC-4, ad...@cs.miami.edu wrote:
Reply all
Reply to author
Forward
0 new messages