ddeadlink
ddeadlink

Reputation: 247

installing package locally gives an error

When i am trying to install package i'm getting this error. In addition all other packages were installed without any problems. How could i solve this. If i'm changing flag to -g (globally) it works, but i need it to be in my project

 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!     <[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

Upvotes: 0

Views: 741

Answers (1)

Parth Ghiya
Parth Ghiya

Reputation: 6949

This occurs when ur npm version is down or the library has been removed.

you need to update your npm version...!!

npm update npm@latest

Upvotes: 1

Related Questions