本文共 1985 字,大约阅读时间需要 6 分钟。
node.js更新
Node.js can be installed in multiple ways on a system, and the upgrade instructions depend on how you first installed it.
Node.js可以通过多种方式安装在系统上,升级说明取决于您首次安装它的方式。
The easiest way to install Node is to download the official package from the .
安装Node的最简单方法是从下载官方软件包。
The official package contains an installer that will detect the existing version of Node.js and it will overwrite it with the new one.
官方软件包包含一个安装程序,它将检测Node.js的现有版本,并将用新版本覆盖它。
Homebrew is a very popular way to install Node.js on a Mac.
Homebrew是在Mac上安装Node.js的一种非常流行的方法。
If you did use Homebrew, upgrading Node is as simple as running
如果您确实使用Homebrew,则升级Node就像运行一样简单
brew update #makes sure Homebrew is up to datebrew upgrade node
Homebrew might ask you to upgrade your xCode version to compile the package.
Homebrew可能会要求您升级xCode版本以编译该软件包。
nvm
(If you use nvm
)nvm
is a popular way to run Node. It allows you to easily switch the Node version, and install new versions to try and easily rollback if something breaks, for example.
nvm
是运行Node的流行方法。 例如,它使您可以轻松切换Node版本,并安装新版本以尝试并轻松回滚。
It is also very useful to test your code with old Node versions.
使用旧的Node版本测试代码也非常有用。
When you use nvm
, you can check the current version you are running by typing nvm current
, which will give you the same result as node -v
.
使用nvm
,可以通过键入nvm current
来检查正在运行的当前版本,这将为您提供与node -v
相同的结果。
To list all the installed versions, run nvm ls
.
要列出所有已安装的版本,请运行nvm ls
。
You can install a new Node release (or any old Node release, too) using nvm install <VERSION>
, for example:
您可以使用nvm install <VERSION>
安装新的Node版本(或任何旧的Node版本),例如:
nvm install 10.8.3
Once installed, you can set that Node.js version to be the one to use by typing
安装完成后,您可以通过键入以下内容将Node.js版本设置为要使用的版本。
nvm use 10.8.3
This will set 10.8.3 to the default Node version, system-wide.
这会将10.8.3设置为系统范围内的默认Node版本。
翻译自:
node.js更新
转载地址:http://yxqgb.baihongyu.com/