Node.js 安装

1、登陆Node.js官方网站:https://nodejs.org/en/,选择操作系统对应的包,点击下载

2、双击运行安装程序

3、点击Next

4、勾选I accept the terms in the License Agreement

5、选择安装路径,点击Next

6、点击Next

7、为了避免以后麻烦,这里强烈建议选择“Automatically install …” ,然后点击Next

  Some npm modules need to compiled from C/C++ when installing. If you want to be able to install such modules, some tools(Python             
  and Visual Studio Build Tools) need to be installed.

这是在告诉会给你自动安装2个工具:

  • 构建工具(Python 和Visual Studio构建工具)
  • Chocolatey

构建工具是因为一些npm模块需要使用C/C++编译,如果想要编译这些模块,则需要安装这个工具。如果不安装这个构建工具,在之后使用 npm 安装模块的时候,会报错:gyp ERR! find Python
如果见到这个错误就是因为没有安装构建工具。

构建工具和 Chocolatey 都是必装的,如果现在没有安装,可以之后再手动安装,提示里已经给出了相关解释:https://github.com/nodejs/node-gyp#on-windows

该提示还告诉你 Chocolatey 会在后面弹出一个 cmd 来安装。

为了避免以后麻烦,这里强烈建议选择“Automatically install …”,然后点击Next

8、点击Install

9、安装中

10、点击Finish

11、自动安装 Chocolatey

博客内容用于记录自己学习后的收获,如有侵权请联系我删除
原文地址:https://www.cnblogs.com/ptxiaochen/p/13723483.html