node.js - Mongodb version specified in package.json fails to install -


if npm install mongodb, desired version of mongodb installed without problem:

- bson@0.1.5 node_modules/mongodb/node_modules/bson mongo-invoices@0.0.0 /home/lorencm/downloads/mongo-invoices └─┬ mongodb@2.1.6    ├── es6-promise@3.0.2    ├─┬ mongodb-core@1.3.1    │ ├── bson@0.4.21    │ └─┬ require_optional@1.0.0    │   ├── resolve-from@2.0.0    │   └── semver@5.1.0    └─┬ readable-stream@1.0.31  ├── core-util-is@1.0.2  ├── inherits@2.0.1  ├── isarray@0.0.1  └── string_decoder@0.10.31 

as have dependencies in package.json stored (see below) , use npm install fails (see below) install mongodb@2.1.6 , instead installs mongodb@1.1.11:

{   "name": "mongo-invoices",   "version": "0.0.0",   "description": "open-source invoice system build on node.js , mongodb",   "main": "app.js",   "dependencies": { "accounting": "~0.4.1", "bcrypt-nodejs": "0.0.3", "emailjs": "~1.0.2", "express": "~4.13.4", "i18n": "^0.6.0", "jade": "~1.11.0", "moment": "~2.11.2", "mongodb": "~2.1.6", "stylus": "~0.53.0"   },   "devdependencies": {},   "scripts": { "test": "echo \"error: no test specified\" && exit 1"   },   "repository": { "type": "git", "url": "git://github.com/gianlucadelgobbo/mongo-invoices.git"   },   "keywords": [ "invoices", "mongodb", "node.js"   ],   "author": "gianluca del gobbo <g.delgobbo@flyer.it>",   "license": "bsd",   "readmefilename": "readme.md",   "private": true } 

.

make[1]: *** [release/obj.target/bson/ext/bson.o] error 1 make[1]: leaving directory `/home/lorencm/downloads/mongo-invoices/node_modules/mongodb/node_modules/bson/build' gyp err! build error  gyp err! stack error: `make` failed exit code: 2 gyp err! stack     @ childprocess.onexit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23) gyp err! stack     @ emittwo (events.js:100:13) gyp err! stack     @ childprocess.emit (events.js:185:7) gyp err! stack     @ process.childprocess._handle.onexit (internal/child_process.js:200:12) gyp err! system linux 4.2.0-23-generic gyp err! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "build" gyp err! cwd /home/lorencm/downloads/mongo-invoices/node_modules/mongodb/node_modules/bson gyp err! node -v v5.5.0 gyp err! node-gyp -v v3.0.3 gyp err! not ok  make: *** [node_gyp] error 1 child process exited code 2 - bson@0.4.21 node_modules/bson - core-util-is@1.0.2 node_modules/core-util-is - es6-promise@3.0.2 node_modules/es6-promise - inherits@2.0.1 node_modules/inherits - isarray@0.0.1 node_modules/isarray - resolve-from@2.0.0 node_modules/resolve-from - semver@5.1.0 node_modules/semver - require_optional@1.0.0 node_modules/require_optional - mongodb-core@1.3.1 node_modules/mongodb-core - string_decoder@0.10.31 node_modules/string_decoder - readable-stream@1.0.31 node_modules/readable-stream mongo-invoices@0.0.0 /home/lorencm/downloads/mongo-invoices └─┬ mongodb@1.1.11    └── bson@0.1.5 

why not install version specified in package.json?

the application fails install 2.1.6 version because of npm-shrinkwrap.json file which:

this command locks down versions of package's dependencies can control versions of each dependency used when package installed.

if inspect npm-shrinkwrap.json mongo-invoices, you'll find specified version mongodb 1.1.11


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -