如果你在使用不受支持或不稳定的 Node 版本(奇数版本,例如 0.7.x、0.9.x、0.11.x)时遇到问题,很可能只需使用 Node 的 LTS 版本就能解决你的问题。

🌐 If you're experiencing issues while using a version of node which is unsupported or unstable (odd numbered versions e.g. 0.7.x, 0.9.x, 0.11.x), it's very possible your issue will be fixed by simply using the LTS version of node.

查看正在运行的 node 版本

🌐 See what version of node you're running:

node -v

在 Linux 上更新 node

🌐 Updating node on Linux

对于某些 Linux 发行版(Debian/Ubuntu 和 RedHat/CentOS),发行版提供的最新 Node 版本可能会滞后于稳定版本。这里有来自 NodeSource 的获取最新 Node 的说明。

🌐 For some Linux distributions (Debian/Ubuntu and RedHat/CentOS), the latest node version provided by the distribution may lag behind the stable version. Here are instructions from NodeSource on getting the latest node.

在 Windows 上更新 node

🌐 Updating node on Windows

https://nodejs.cn/download 安装最新的 MSI

🌐 Install the latest msi from https://nodejs.cn/download

在 macOS 上更新 Node

🌐 Updating node on macOS

https://nodejs.cn/download 安装最新的软件包

🌐 Install the latest package from https://nodejs.cn/download

或者如果你正在使用 homebrew

🌐 or if you are using homebrew

brew install node

保持最新状态的简单方法

🌐 An easy way to stay up-to-date

Node.js 有很多版本,并且其开发非常活跃。为了更好地管理各种版本,我们建议你在安装 Node.js 时使用版本管理工具。有很多不错的选择,这里列出几个:

🌐 Node.js has lots of versions, and its development is very active. As a good practice to manage the various versions, we recommend that you use a version manager for your Node.js installation. There are many great options, here are a few: