node.js and yarn installation

Computer environment windows10 Pro 64

node.js installation

Node.js official website: https://nodejs.org/en/

After a step by step installation was a fool

Configuration environment variable and view node.js and npm version

Npm path configuration and path caching global cache at installation module

For example, when performing because npm install webpack -g command and other global installed, the default with modules installed in C: \ Users \ username \ AppData \ npm and npm_cache under Roaming path management is not convenient and takes up C drive space. So here you configure a custom installation global directory module, and two new folders node_global node_cache in node.js installation directory,

 

Then execute the following two commands in cmd command:

npm config set prefix "D:\Program Files\nodejs\node_global"

npm config set cache "D:\Program Files\nodejs\node_cache"

 

execution succeed. Then in the environment variable - New> a system variable named variable "NODE_PATH", is "D: \ nodejs \ node_modules", as shown below:

 

Last edited user variables in the Path, will be before the corresponding npm path C: \ User \ user \ AppData \ Roaming \ npm read: D: \ nodejs \ node_global

Implementation of npm install webpack -g command in cmd then you can see two custom file folders in effect after successful installation:

 

 

Installation yarn

Download: https://yarnpkg.com/zh-Hans/docs/install#windows-stable

Fool step by step installation

After installing performed npm install -g yarn under cmd 

Query yarn version

 

Guess you like

Origin www.cnblogs.com/yang-xiansen/p/11332610.html