npm install sails-mongo --save not working

时间:2015-10-14 09:34:13

标签: mongodb npm sails.js waterline sails-mongo

我想在我的风帆项目中添加sails-mongo。但是当我尝试安装sails-mongo(npm install sails-mongo --save)时。它显示错误:

~/newWebApp $ npm install sails-mongo --save

npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "node" "/usr/bin/npm" "install" "sails-mongo" "--save"
npm ERR! node v0.10.37
npm ERR! npm  v3.3.3

npm ERR! Cannot set property 'lodash' of undefined
npm ERR! 
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>
npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "node" "/usr/bin/npm" "install" "sails-mongo" "--save"
npm ERR! node v0.10.37
npm ERR! npm  v3.3.3

npm ERR! Cannot set property 'waterline-criteria' of undefined
npm ERR! 
npm ERR! If you need help, you may report this error at:

npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "node" "/usr/bin/npm" "install" "sails-mongo" "--save"
npm ERR! node v0.10.37
npm ERR! npm  v3.3.3

npm ERR! Cannot set property 'waterline-errors' of undefined
npm ERR! 
npm ERR! If you need help, you may report this error at:

npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "node" "/usr/bin/npm" "install" "sails-mongo" "--save"
npm ERR! node v0.10.37
npm ERR! npm  v3.3.3

npm ERR! Cannot set property 'fs-extra' of undefined
npm ERR! 
npm ERR! If you need help, you may report this error at:

npm ERR! Linux 3.13.0-24-generic
npm ERR! argv "node" "/usr/bin/npm" "install" "sails-mongo" "--save"
npm ERR! node v0.10.37
npm ERR! npm  v3.3.3

npm ERR! Cannot set property 'waterline-cursor' of undefined
npm ERR! 
npm ERR! If you need help, you may report this error at:


npm ERR! Please include the following file with any support request:
npm ERR!     /home/vgulp/newWebApp/npm-debug.log

1 个答案:

答案 0 :(得分:3)

由于sails-mongo(或其依赖项)包与最新的npm不兼容。

sudo npm install npm@2.14.5 -g

然后运行

npm install sails-mongo --save

应该解决你的问题。