在安装mongoose-auto-increment和mongoose-simpledb时,npm错误代码EPEERINVALID

您好,我遇到了以下错误,同时安装npm包mongoose自动增量和mongoose-simpledb全球和本地。

错误如下

mongoose,自动递增

npm WARN peerDependencies The peer dependency mongoose@~4.0.0 included from mongoose-auto-increment will no npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly. npm ERR! Darwin 14.0.0 npm ERR! argv "node" "/usr/local/bin/npm" "install" "mongoose-auto-increment" npm ERR! node v0.12.4 npm ERR! npm v2.11.2 npm ERR! code EPEERINVALID npm ERR! peerinvalid The package mongoose does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer mongoose-auto-increment@4.0.0 wants mongoose@~4.0.0 npm ERR! Please include the following file with any support request: npm ERR! /Users/febinp/Downloads/Shubham_application/Project/npm-debug.log 

mongoose-的SimpleDB

  npm ERR! Darwin 14.0.0 npm ERR! argv "node" "/usr/local/bin/npm" "install" "mongoose-simpledb" npm ERR! node v0.12.4 npm ERR! npm v2.11.2 npm ERR! code EPEERINVALID npm ERR! peerinvalid The package mongoose does not satisfy its siblings' peerDependencies requirements! npm ERR! peerinvalid Peer mongoose-auto-increment@4.0.0 wants mongoose@~4.0.0 npm ERR! peerinvalid Peer mongoose-simpledb@4.0.3 wants mongoose@~3.8.18 npm ERR! Please include the following file with any support request: npm ERR! /Users/febinp/Downloads/Shubham_application/Project/npm-debug.log 

我的Package.json如下

 { "name": "Project", "private": true, "version": "0.0.0", "description": "a Sails application", "keywords": [], "dependencies": { "async": "^1.4.0", "ejs": "~0.8.4", "grunt": "0.4.2", "grunt-contrib-clean": "~0.5.0", "grunt-contrib-coffee": "~0.10.1", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-copy": "~0.5.0", "grunt-contrib-cssmin": "~0.9.0", "grunt-contrib-jst": "~0.6.0", "grunt-contrib-less": "0.11.1", "grunt-contrib-uglify": "~0.4.0", "grunt-contrib-watch": "~0.5.3", "grunt-sails-linker": "~0.9.5", "grunt-sync": "~0.0.4", "include-all": "~0.1.3", "mongoose": "^4.1.0", "mongoose-acl": "^0.2.3", "mongoose-unique-validator": "^0.4.1", "passport-local-mongoose": "^1.0.1", "rc": "~0.5.0", "sails": "~0.11.0", "sails-disk": "~0.10.0" }, "scripts": { "debug": "node debug app.js", "start": "node app.js" }, "main": "app.js", "repository": { "type": "git", "url": "git://github.com/febinp/ZATASA.git" }, "author": "XYZ", "license": "" } 

有人可以帮我,为什么我得到这个错误,什么是解决方法?

  1. 在你的package.jsonmongoose有一个更高的版本4.0.0。 但是mongoose-simpledb

  2. mongoose-simpledb包括它的依赖mongoose-simpledb mongoose-auto-increment 。 如果显式声明模式中的_id字段为Numbertypes,则simpledb将自动调用该模型的mongoose-auto-increment插件。

文档本身的例子:

 exports.schema = { _id: Number, // Causes simpledb to auto-increment _id for new documents. creator: { type: Number, ref: 'User' } }; 

我试图改变这个package.json和它的工作:

 { "name": "Project", "private": true, "version": "0.0.0", "description": "a Sails application", "keywords": [], "dependencies": { "async": "^1.4.0", "ejs": "~0.8.4", "grunt": "0.4.2", "grunt-contrib-clean": "~0.5.0", "grunt-contrib-coffee": "~0.10.1", "grunt-contrib-concat": "~0.3.0", "grunt-contrib-copy": "~0.5.0", "grunt-contrib-cssmin": "~0.9.0", "grunt-contrib-jst": "~0.6.0", "grunt-contrib-less": "0.11.1", "grunt-contrib-uglify": "~0.4.0", "grunt-contrib-watch": "~0.5.3", "grunt-sails-linker": "~0.9.5", "grunt-sync": "~0.0.4", "include-all": "~0.1.3", "mongoose": "~3.8.18", "mongoose-simpledb": "~4.0.3", "mongoose-acl": "^0.2.3", "mongoose-unique-validator": "^0.4.1", "passport-local-mongoose": "^1.0.1", "rc": "~0.5.0", "sails": "~0.11.0", "sails-disk": "~0.10.0" }, "scripts": { "debug": "node debug app.js", "start": "node app.js" }, "main": "app.js", "repository": { "type": "git", "url": "git://github.com/febinp/ZATASA.git" }, "author": "XYZ", "license": "" }