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

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

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


当前回答

我知道这个问题很久以前就被问过了,但也许它对其他人有帮助。 我可以向那些正在寻找在不同版本的NodeJS之间切换的人推荐这个实用程序(NVS - Node Version Switcher):

https://github.com/jasongin/nvs

其他回答

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

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

窗户

用巧克力降级节点

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

choco install nodejs.install -version 6.3.0

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

Downgrade NPM

npm install -g npm@3.10.3

我发现安装特定版本node.js的最简单方法:

首先卸载你的node.js 访问https://nodejs.org/en/download/releases/,找到你想要的版本。

选择您的版本并单击下载按钮。 下载。msi文件

一种方法是使用NVM,即节点版本管理器。

使用以下命令获取nvm

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash

你可以在https://github.com/creationix/nvm上找到它

它允许您轻松地安装和管理多个版本的node。下面是帮助中的一个片段:

Usage:
nvm install <version>       Download and install a <version>
nvm use <version>           Modify PATH to use <version>
nvm ls                      List versions (installed versions are blue)

运行这个:

rm -rf node_modules && npm cache clear && npm install

节点将从缓存的文件中安装。所以如果你先清除所有东西,那么NPM使用0.10。Xx,它将恢复正常。