我在Ubuntu 10.10上运行Node.js v0.5.9-pre版本。

我希望使用v0.5.0-pre版本。

如何回滚到节点的旧版本?


当前回答

NVM install 0.5.0 #安装之前选择的版本

NVM别名默认0.5.0 #设置为默认值

NVM use default #使用新的默认值作为全局激活版本。

如果没有最后一个参数,活动版本不会更改为新的默认值。因此,当您打开一个新终端或重新启动服务器时,旧的默认版本仍然是活动的。

其他回答

我的节点版本是6.4.0。

由于我需要旧版本的6.3.0,我刚刚在我的系统中重新安装了6.3.0版本。节点版本自动降级。

因此,为了降低节点版本, 只需要安装旧版本的node js。它会自动从更高的版本降级。

我在osx试过。这招很管用。

如果你已经安装了你想要的节点版本,但似乎无法切换到它,试试这个:

nvm use --delete-prefix <version>. npm shows the lates version installed but can't switch to it. If so, this is the output you will see: You need to run "nvm install v16.2.0 Then run:nvm install <type the version you wish to use here>Your output should look like this: Downloading and installing node v16.2.0... Downloading https://nodejs.org/dist/v16.2.0/node-v16.2.0-linux-x64.tar.xz... ####################################################################### 100.0% Computing checksum with sha256sum Checksums matched! Now using node v16.2.0 (npm v7.13.0) Creating default alias: default -> v16.2.0 You are done! You can see the latest version by running: node -v

为此,您需要安装NVM。

对于Mac

使用下面的命令编辑.bash_profile。

nano .bash_profile

并将以下行添加到.bash_profile

export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh

保存它。退出终端并检查魔法。

然后使用下面的命令安装所需的版本。

nvm install v14.18.0

如果您想检查系统上已安装的节点版本。使用下面的命令。

nvm ls

如果您想从已安装的节点版本中使用特定版本。使用以下命令

nvm use 12.14.4

窗户

用巧克力降级节点

安装巧克力色。然后运行:

choco install nodejs.install -version 6.3.0

Chocolatey拥有许多可用的Node版本。

Downgrade NPM

npm install -g npm@3.10.3

如果你已经为我安装了curl,请按照以下步骤操作

Sudo snap remove curl Sudo apt安装卷曲 NVM安装12.2.0