2015-10-14 53 views
1

我想在我的sails項目中添加sails-mongo。但是當我試圖安裝sails-mongo(npm install sails-mongo --save)。它顯示錯誤:npm安裝sails-mongo - 保存不起作用

~/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 
+0

在3.3.9上運行 - 工作正常。 – ghaiklor

回答

3

其因sails-mongo不兼容(或它的依賴)封裝,最新的NPM。

sudo npm install [email protected] -g

然後運行

npm install sails-mongo --save

應該解決您的問題。