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

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

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


当前回答

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

其他回答

运行这个:

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

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

窗户

用巧克力降级节点

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

choco install nodejs.install -version 6.3.0

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

Downgrade NPM

npm install -g npm@3.10.3

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

https://github.com/jasongin/nvs

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

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

现在v0.5.0-pre已经走到了生命的尽头。我们可以使用npx来使用node的任何稳定的旧版本。例如,最早的稳定版本是4.9.0。

npx -p node@4.9.0 -- node -v