The windows system completely uninstalls and reinstalls Node (pro-test available)

The windows system completely uninstalls and reinstalls Node (pro-test available)

insert image description here

After completing the above 6 steps, start to re-download and configure Node

insert image description here

根据自己的需要下载对应版本即可

Installation complete view

查看是否安装成功

A. node -v View node version

B. npm -v View npm version

img

2. After the installation is complete, the file directory is as shown below

img

If npx is 5.2.0+, a new package will be installed npx. npx is a tool designed to improve the experience of using packages from the npm registry, npm makes it very easy to install and manage dependencies hosted on the registry, npx makes using CLI tools and other hosted on the registry, greatly simplified some things.

Environment configuration

The environment configuration here mainly configures the path where the global module installed by npm is located, and the path of the cache cache. The reason to configure it is because it will be executed later: npm install express [-g] (the following optional parameters - g, g stands for global installation), the installed module will be installed in the [C:\Users\username\AppData\Roaming\npm] path, occupying the C disk space.
  For example: I want to put the path of the whole module and the cache path in the folder where I installed node.js, then create two folders [node_global] and [node_cache] in my installation directory as shown below:

img

1. Set the global directory and the cache directory. After creating two empty folders, open the cmd command window and enter

npm config set prefix "D:\SDE\Node8.9.4\node_global"

npm config set cache "D:\SDE\Node8.9.4\node_cache"

img

Reconfigure:

1. Set environment variables, "My Computer" - right click - "Properties" - "Advanced System Settings" - "Advanced" - "Environment Variables"

A. Enter the environment variable dialog box, create a new [NODE_PATH] under [System Variables], and enter [D:\SDE\Node8.9.4\node_modules]

B. Change [Path] under [User Variables] to [D:\SDE\Node8.9.4\node_global]

img

img

img

After modification, click the "OK" button.

Guess you like

Origin blog.csdn.net/Web_chicken/article/details/127774552