简体   繁体   中英

Npm throws error

i have a really serious problem with npm, when i trying to get a api like bluebird or fs, i can't because npm throws me that error.

npm install bluebird -g
npm WARN npm npm does not support Node.js v0.8.20
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can't make any promises that npm will work with this version.
npm WARN npm You can find the latest version at https://nodejs.org/

/usr/local/lib/node_modules/npm/lib/install.js:298
        [this, (next) => { computeMetadata(this.idealTree); next() }],
                       ^
npm ERR! Unexpected token >

i'm new in ubuntu and i don't know how to solve this problem, can you help me please

What happened for me was a naming conflict with old versions of node, so that the newer versions were ignored that I attempted to install. I would be informed I had the latest version of node, and npm, but this was obscured by the old version. To fix it, I had to completely uninstall it using the following:

sudo apt-get remove --purge node

http://www.hostingadvice.com/how-to/install-nodejs-ubuntu-14-04/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM