如何安装Node.js

Node.js can be installed in different ways.

Node.js可以通过不同的方式进行安装。

Let me how you the most common and convenient ones.

让我告诉你最普通和方便的人。

Official packages for all the major platforms are available at https://nodejs.org/en/download/.

有关所有主要平台的官方软件包,请访问https://nodejs.org/en/download/

There you can choose to download an LTS version (LTS stands for Long Term Support) or the latest available release. As usual, the latest version contains the latest goodies.

您可以在此处选择下载LTS版本(LTS代表长期支持)或最新版本。 与往常一样,最新版本包含最新的好东西。

On the site they have packages for Windows, Linux, macOS.

在站点上,他们具有适用于Windows,Linux和macOS的软件包。

One very convenient way to install Node.js is through a package manager. In this case, every operating system has its own.

一种非常方便的安装Node.js的方法是通过程序包管理器。 在这种情况下,每个操作系统都有其自己的。

On macOS, Homebrew is the de-facto standard, and - once installed - allows to install Node.js very easily, by running this command in the CLI:

在macOS上, Homebrew是事实上的标准,并且-在安装后-通过在CLI中运行以下命令,可以非常轻松地安装Node.js:

brew install node

Other package managers for Linux and Windows are listed in https://nodejs.org/en/download/package-manager/

https://nodejs.org/en/download/package-manager/中列出了其他适用于Linux和Windows的软件包管理器

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版本测试代码也非常有用。

See https://github.com/creationix/nvm for more information about this option.

有关此选项的更多信息,请参见https://github.com/creationix/nvm

My suggestion is to use the official installer if you are just starting out and you don’t use Homebrew already, otherwise, Homebrew is my favorite solution because I can easily update node by running brew upgrade node.

我的建议是,如果您刚刚起步并且还没有使用Homebrew,请使用官方安装程序,否则,Homebrew是我最喜欢的解决方案,因为我可以通过运行brew upgrade node轻松更新brew upgrade node

In any case, when Node is installed you’ll have access to the node executable program in the command line.

无论如何,安装Node后,您将可以在命令行中访问node可执行程序。

翻译自: https://flaviocopes.com/node-installation/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值