简体   繁体   English

安装/更新npm和NodeJS

[英]Installing/updating npm & NodeJS

I have an old version of NPM and NodeJS installed on my AWS server. 我的AWS服务器上安装了NPM和NodeJS的旧版本。 I really just need bower to work to install a module. 我真的只需要凉亭即可安装模块。 npm version is 1.1.0-2. npm版本是1.1.0-2。 Node version is 0.6.8. 节点版本为0.6.8。

sudo npm install -g npm

Results in: 结果是:

npm ERR! System Linux 3.10.42-52.145.amzn1.x86_64
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "npm"
npm ERR! cwd /home/ec2-user/node-v0.10.33-linux-x64
npm ERR! node -v v0.6.8
npm ERR! npm -v 1.1.0-2
npm ERR! message failed to fetch from registry: npm

Also tried NodeJS from source. 还从源头尝试了NodeJS。 README says use the usual ./configure, make, make install. README说使用通常的./configure、make、make install。 Caveat: no configure script. 注意:没有配置脚本。 :-/ : - /

Ready to throw my hands up. 准备举起我的手。

请尝试在终端中运行以下命令:

curl https://www.npmjs.org/install.sh | sh

Okay, the source code eventually did work. 好的,源代码最终成功了。 I had downloaded the binaries by mistake. 我错误地下载了二进制文件。 (Odd that they come w/ a README telling you how to build the source code). (奇怪的是,它们带有自述文件,告诉您如何构建源代码)。

Hoping anyone else looking to upgrade can learn something from this. 希望其他任何希望升级的人都可以从中学到一些东西。

Anywho, I'm good on this for now. 任何人,我现在对此都很擅长。 Thanks for the input. 感谢您的输入。

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

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