Node.js 如何在ubuntu中升级节点?

Node.js 如何在ubuntu中升级节点?,node.js,npm,version,upgrade,Node.js,Npm,Version,Upgrade,我无法在Ubuntu中安装节点版本4.7,当我升级节点时,它显示节点4.2.6已经是最新版本。 我需要安装npm,只有node 4.7或更高版本才允许安装npm。您可以试试这个 Upgrading to the latest stable version This will update you to the latest available stable version: sudo npm cache clean -f sudo npm install -g n sudo n stable

我无法在Ubuntu中安装节点版本4.7,当我升级节点时,它显示节点4.2.6已经是最新版本。 我需要安装npm,只有node 4.7或更高版本才允许安装npm。

您可以试试这个

Upgrading to the latest stable version

This will update you to the latest available stable version:

sudo npm cache clean -f
sudo npm install -g n
sudo n stable
Upgrading to the latest LTS version

Node also offers a long-term support (LTS) version. If you need that version (or any other), simply specify the version number you want:

sudo npm cache clean -f
sudo npm install -g n
sudo n 4.4.2
Checking your Node version

To see which version of Node is currently installed, simply run:

node -v

我的节点版本可能重复4.2.6,npm仅在4.7或更高版本中受支持。所以我不能像你建议的那样使用命令。你能从必要的输出开始列出你使用的命令吗