简体   繁体   English

无法在Ubuntu Server 16.04上升级NPM

[英]Not able to upgrade NPM on Ubuntu Server 16.04

I'm trying to upgrade NPM on an Ubuntu Server (16.04) however, it is not upgrading at all. 我正在尝试在Ubuntu Server(16.04)上升级NPM,但是它根本没有升级。

npm -v

returns 3.5.2 返回3.5.2

When I run 当我跑步

sudo npm install npm@latest -g

I get the following: 我得到以下内容:

/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
+ npm@5.0.3
updated 1 package in 7.414s

However when I check the version it still shows as 3.5.2 . 但是,当我检查版本时,它仍然显示为3.5.2 Why does this not upgrade? 为什么不升级?

I suggest you to use nvm and execute commands: 我建议您使用nvm并执行命令:

nvm install 8.0
nvm use 8.0

This should bring you close to latest versions of both node and npm 这应该使您接近node和npm的最新版本。

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

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