0

I have no idea why I get an error for mongoskin. I used this module before but I got rid of it. I removed the node_modules directory then did a fresh npm install, fine everything installs. Then I tried to add a new module minimist as seen below:

C:\www\instantynode\src>npm install minimist --save
npm WARN package.json instanty@0.1.1 No description
npm WARN package.json instanty@0.1.1 No repository field.
npm WARN package.json instanty@0.1.1 No README data
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "minimist" "--save"
npm ERR! node v4.4.0
npm ERR! npm  v2.14.20
npm ERR! code EPEERINVALID

npm ERR! peerinvalid The package mongodb@2.1.4 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer mongoskin@1.4.13 wants mongodb@~1.4

npm ERR! Please include the following file with any support request:
npm ERR!     C:\www\instantynode\src\npm-debug.log

package.json:

{
  "name": "app",
  "version": "0.1.1",
  "description": "",
  "dependencies": {
    "bunyan": "1.5.1",
    "co": "4.6.0",
    "cookie-parser": "^1.4.0",
    "forever": "^0.15.1",
    "fs": "0.0.2",
    "geoip-lite": "^1.1.6",
    "handlebars": "^4.0.5",
    "jsonwebtoken": "^5.4.1",
    "jwt-simple": "^0.4.0",
    "koa": "^1.1.2",
    "koa-better-ratelimit": "^2.1.2",
    "koa-bodyparser": "^2.0.1",
    "koa-conditional-get": "^1.0.3",
    "koa-generic-session": "^1.10.0",
    "koa-handlebars": "^0.5.7",
    "koa-mount": "^1.3.0",
    "koa-multer": "1.0.0",
    "koa-passport": "^2.0.1",
    "koa-redis": "^1.0.1",
    "koa-router": "^5.3.0",
    "koa-static": "^1.5.2",
    "lodash": "^3.10.1",
    "mongodb": "2.1.4",
    "nodemailer": "2.1.0",
    "nodemon": "^1.8.1",
    "passport": "^0.3.2",
    "passport-http-bearer": "^1.0.1",
    "passport-local": "^1.0.0",
    "socket.io": "^1.3.7",
    "socketio-jwt": "^4.3.3"
  },
  "devDependencies": {
    "assert": "1.3.0",
    "del": "2.1.0",
    "gulp": "^3.9.1",
    "gulp-autoprefixer": "3.1.0",
    "gulp-concat": "2.6.0",
    "gulp-concat-css": "2.2.0",
    "gulp-imagemin": "2.4.0",
    "gulp-less": "3.0.5",
    "gulp-minify-css": "1.2.2",
    "gulp-notify": "2.2.0",
    "gulp-uglify": "1.5.1",
    "imagemin-pngquant": "4.2.0",
    "jsdoc": "3.4.0",
    "node-inspector": "0.12.5",
    "run-sequence": "1.1.5"
  },
  "main": "app.js",
  "scripts": {
    "startfn": "forever start -c \"nodemon --harmony\" app.js --exitcrash",
    "startf": "forever start -c \"node --harmony\" app.js",
    "start": "node --harmony app.js"
  },
  "author": "",
  "license": "ISC"
}

npm install minimist --save does not work as you can see, does not install or add itself to the package.json file. And it is still mentioning mongoskin?

I have a feeling that the NPM in Windows is buggy?

basickarl
  • 37,187
  • 64
  • 214
  • 335

4 Answers4

0

You are trying to install minimist, which has its own package.json with its own dependencies. In these it says that it wants mongoskin to be installed, which has a dependency on mongodb itself, but in another version than you have it (you have 2.1.4 but as the error says, it needs ~1.4).

So, because you provided the --save parameter, you want npm to respect these dependencies and do not install mongodb in the desired version on top of it.

krassdanke
  • 617
  • 6
  • 24
  • However, I thought this was the whole reason behind NPM, was that each module has it's own independent module dependencies? – basickarl Mar 15 '16 at 10:41
  • That is right. But, see [this](http://stackoverflow.com/questions/19578796/what-is-the-save-option-for-npm-install), --safe tells npm to look into your app's depencies first. – krassdanke Mar 15 '16 at 10:45
  • I provided the `--save` flag, not the `--safe` flag. I'll install without saving see what it does. – basickarl Mar 15 '16 at 10:53
  • I tried a simple `npm install minimist` and the same error appears :/ The weird thing is, is that I normally run Linux and everything works perfectly there, it's just Windows complaining. – basickarl Mar 15 '16 at 10:56
0

i think that mongoskin only work with mongodb driver older than 1.4. You might have installed mongoskin in global mode, try to remove it.

guiguiblitz
  • 407
  • 4
  • 10
0

Ok I've found the issue. The NPM in Windows is way more sensitive than the one in Linux. In Linux I can manually remove the line from the package.json file and just remove the node_modules directory. However in Windows it appears to be cached by NPM, so I had to manually use the npm remove mongoskin --save command.

When I did this so that the package.json looked like it should I was able to install minimist via npm install minimist --save without issues!

I'm not surprised Windows... Not surprised...

basickarl
  • 37,187
  • 64
  • 214
  • 335
0

In your package.json, try to change this:

"mongodb": "2.1.4",

to this:

"mongodb": "1.4.*",
zsolt.k
  • 673
  • 4
  • 6