2017-02-27 96 views
0

当我尝试安装软件包时,出现此错误。另外所有其他软件包安装没有任何问题。我怎么能解决这个问题。如果我改变了标志-g(全球)它的工作原理,但我需要它是在我的项目在本地安装软件包时出现错误

npm install --save express-validator 
    npm http GET https://registry.npmjs.org/express-validator 
    npm http 304 https://registry.npmjs.org/express-validator 
    npm http GET https://registry.npmjs.org/lodash 
    npm http GET https://registry.npmjs.org/validator 
    npm http 304 https://registry.npmjs.org/lodash 
    npm http 304 https://registry.npmjs.org/validator 
    npm http GET https://registry.npmjs.org/types/bluebird 
    npm http GET https://registry.npmjs.org/types/express 
    npm http 404 https://registry.npmjs.org/types/bluebird 
    npm ERR! TypeError: Cannot read property 'latest' of undefined 
    npm ERR!  at next (/usr/share/npm/lib/cache.js:687:35) 
    npm ERR!  at /usr/share/npm/lib/cache.js:675:5 
    npm ERR!  at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:142:7) 
    npm ERR!  at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7 
    npm ERR!  at Object.oncomplete (fs.js:107:15) 
    npm ERR! If you need help, you may report this log at: 
    npm ERR!  <http://github.com/isaacs/npm/issues> 
    npm ERR! or email it to: 
    npm ERR!  <[email protected]> 

    npm ERR! System Linux 3.19.0-30-generic 
    npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "express-validator" 
    npm ERR! cwd /home/prog/work/appJS 
    npm ERR! node -v v0.10.25 
    npm ERR! npm -v 1.3.10 
    npm ERR! type non_object_property_load 
    npm http 404 https://registry.npmjs.org/types/express 
    npm ERR! TypeError: Cannot read property 'latest' of undefined 
    npm ERR!  at next (/usr/share/npm/lib/cache.js:687:35) 
    npm ERR!  at /usr/share/npm/lib/cache.js:675:5 
    npm ERR!  at saved (/usr/share/npm/node_modules/npm-registry-client/lib/get.js:142:7) 
    npm ERR!  at /usr/lib/nodejs/graceful-fs/polyfills.js:133:7 
    npm ERR!  at Object.oncomplete (fs.js:107:15) 
    npm ERR! If you need help, you may report this log at: 
    npm ERR!  <http://github.com/isaacs/npm/issues> 
    npm ERR! or email it to: 
    npm ERR!  <npm-[email protected]> 

    npm ERR! System Linux 3.19.0-30-generic 
    npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "--save" "express-validator" 
    npm ERR! cwd /home/prog/work/appJS 
    npm ERR! node -v v0.10.25 
    npm ERR! npm -v 1.3.10 
    npm ERR! type non_object_property_load 
    npm ERR! 
    npm ERR! Additional logging details can be found in: 
    npm ERR!  /home/prog/work/appJS/npm-debug.log 
    npm ERR! not ok code 0 
+1

更新你的npm,你使用的是哪个版本的npm? –

+0

是1.3.10所以我更新到4.3.0,它的工作原理)谢谢你 – ddeadlink

+0

我会加入它的答案,你可以接受:D –

回答

1

这发生在乌尔NPM版本已关闭或库已被删除。

你需要更新你的npm版本......!

npm update [email protected]