Node.js installation detailed tutorial

1. Install Node.js

1) Download the installation package

Download address
You can choose by yourself zipor .msi, it is recommended .msi
insert image description here
to choose the installation path after downloading nextand install directly
insert image description here
insert image description here

2) Environment installation

Right-click on [Personal Computer] → [Properties] → [Advanced System Settings],
insert image description here
check [path] in the system variable, and click [Edit]
insert image description here

insert image description here

3) Check whether it is installed

 node -v
npm -v

insert image description here

pm -v:查看npm安装的版本。
npm init:会引导你建立一个package.json文件,包括名称、版本、作者等信息。
npm list:查看当前目录下已安装的node包。
npm ls:查看当前目录下已安装的node包。
npm install moduleNames:安装Node模块到本地目录node_modules下。
npm install < name > -g:将包安装到全局环境中。
npm install < name > --save:安装的同时,将信息写入package.json中,项目路径中若是有package.json文件时,直接使用npm install方法就能够根据dependencies配置安装全部的依赖包,这样代码提交到git时,就不用提交node_modules这个文件夹了。
npm install < name> --save-dev:安装的同时,将信息写入package.json中项目路径中若是有package.json文件时,直接使用npm install方法就能够根据devDependencies配置安装全部的依赖包,这样代码提交到git时,就不用提交node_modules这个文件夹了。
npm uninstall moudleName:卸载node模块。

Guess you like

Origin blog.csdn.net/weixin_45428910/article/details/130908851