Windows environment node installation tutorial (ultra-detailed)

Installation node.js

1. Download node:

Download: http://nodejs.cn/download/

When node.js zip package is mounted directly after decompressing it,

node.js the msi package is a fool all the way next to it

In a way you can choose

2. After extracting the directory or directory after installation mis follows:

 

3. After installation, you can input node -v on the command line to see the installed version and whether the installation is successful

The following two parts 4,5 at node C is the default user directory Reaming inside the disc, may be provided may not be provided with you, I C to save disc space, it extracts the master to switch to the next directory.

4. build folder

In the document the position shown above, two new directories and

node- Global: Global NPM installation location 

Node -cache: NPM  

 5. Modify configuration npm

Npm modify configuration
storage npm path configuration and the path of the global cache module can be completed by about two orders.

npm config set prefix "D:\Node.js\node-global"
npm config set cache "D:\Node.js\node-cache"

Such modules are mounted thereafter mounted to the lower change path.

6. Set Environment Variables

6.1.node_path environment variables:

The catalog where node.exe added to the path environment variable, so we can use the command line using the node command in any path,

D:\Node.js\

6.2.node_gloable environment variables:

Since webpack done in node-global mapping folder, so it will join the node-global path environment variable.

D:\Node.js\node-global

7. Test npm install -g grunt-cli

 

Guess you like

Origin www.cnblogs.com/hualess/p/11541908.html