简体   繁体   English

Npm引发错误

[英]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时遇到了一个非常严重的问题,当我尝试获取像bluebird或fs这样的api时,我不能这样做,因为npm会向我抛出该错误。

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 我是ubuntu的新手,我不知道如何解决这个问题,请您能帮我吗

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. 我会被告知我拥有最新版本的node和npm,但是这被旧版本掩盖了。 To fix it, I had to completely uninstall it using the following: 要修复它,我必须使用以下方法完全卸载它:

sudo apt-get remove --purge node sudo apt-get remove --purge节点

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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