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

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

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


当前回答

我发现最简单的方法就是使用nodejs.org网站:

访问https://nodejs.org/en/download/releases/ 找到你想要的版本,然后点击下载 在MAC上单击.pkg可执行文件,并按照安装说明(不确定windows下正确的可执行文件是什么) 现在您已经在所需的节点版本上了

其他回答

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

https://github.com/jasongin/nvs

出于某种原因,Brew将节点5安装到一个名为node5的单独目录中。

为了回到第5版,我采取了以下步骤:(你需要查找标准的brew安装/卸载,但除此之外,这个过程比看起来要简单得多。)

使用Brew标准安装安装node5,但还没有Brew link。 使用brew unlink节点和brew Uninstall节点卸载所有其他版本的节点。您可能需要使用——force来删除其中一个版本。 在你的电脑上找到地窖文件夹 删除地窖中的节点文件夹。 将node5文件夹重命名为node。 然后,酿造链接节点

节点5应该都设置好了。

为此,您需要安装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

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

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

另一个用于管理多个版本Node的很好的库是N: https://github.com/visionmedia/n