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

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

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


当前回答

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

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

其他回答

一种方法是使用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,它将恢复正常。

NIX (Linux, OS X, ...)

使用n,一个非常简单的Node版本管理器,可以通过npm安装。

假设你想要Node.js v0.10。x来构建Atom。

npm install -g n   # Install n globally
n 0.10.33          # Install and use v0.10.33
Usage:
n                            # Output versions installed
n latest                     # Install or activate the latest node release
n stable                     # Install or activate the latest stable node release
n <version>                  # Install node <version>
n use <version> [args ...]   # Execute node <version> with [args ...]
n bin <version>              # Output bin path for <version>
n rm <version ...>           # Remove the given version(s)
n --latest                   # Output the latest node version available
n --stable                   # Output the latest stable node version available
n ls                         # Output the versions of node available

 

窗户

使用nvm- Windows,它类似于nvm,但适用于Windows。下载并运行安装程序,然后:

nvm install v0.10.33         # Install v0.10.33
nvm use v0.10.33             # Use v0.10.33
Usage:
nvm install [version]        # Download and install [version]
nvm uninstall [version]      # Uninstall [version]
nvm use [version]            # Switch to use [version]
nvm list                     # List installed versions

nvmw已不再维护,但我找到了另一个似乎是最新的源代码(截至1/4/17)。

nvm-windows

它的工作原理。允许我降级到6.3.1

我在这方面遇到了很多问题,唯一对我有效的解决方案是:

~ / .nvm / nvm.sh来源 NVM是node_version_you_want NVM使用node_version_you_want