我不知道爲什麼我得到一個錯誤爲mongoskin
。我以前使用過這個模塊,但是我擺脫了它。我刪除了node_modules目錄,然後進行了全新的npm安裝,很好的安裝了一切。然後我試圖添加一個新的模塊minimist
,如下圖所示:Windows中的NPM不安裝模塊或添加到package.json
C:\www\instantynode\src>npm install minimist --save
npm WARN package.json [email protected] No description
npm WARN package.json [email protected] No repository field.
npm WARN package.json [email protected] 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 [email protected] does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer [email protected] wants [email protected]~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
不起作用,你可以看到,不安裝或自己添加到包。 json文件。它仍然提到mongoskin
?
我有一種感覺,Windows中的NPM是越野車?
然而,我認爲這是NPM背後的全部原因,是每個模塊都有自己獨立的模塊依賴關係? –
這是正確的。但是,請參閱[this](http://stackoverflow.com/questions/19578796/what-is-the-save-option-for-npm-install),--safe告訴npm先查看應用程序的依賴關係。 – dth
我提供了'--save'標誌,而不是'--safe'標誌。我將在不保存的情況下安裝,看看它的功能。 –