2017-02-27 127 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]