How does Windows upgrade the node version? solve

Node.js already exists locally and needs to be upgraded to a higher version. how should I do it? The detailed steps are as follows:

Operation method:

1. Go to the official website of node (http://nodejs.cn/download/) and find the version to be upgraded

As shown in the picture:
Download the node installation package

2. Choose the version that suits your computer and click to download.

If there is no required version above, click "All Installation Packages" at the bottom, it will jump to a new page, just change the path to the required version number, I manually input v16.14.0 here , as shown in the figure:
Select the required installation package

3. Operation after downloading

(1) If it is a zip compressed package:
① Unzip it.
② Go to the original node folder and delete all files exceptnode_global global dependencies and global cache .node_cache
The original nodejs folder

③ Copy the file decompressed in step ① to the original nodejs folder.
This is complete, you can enter it on the command line node -vto verify, you can see that it is the latest version.
(2) If it is an .msi installation package:
double-click to run it, and there is an installation guide.
Follow the prompts and click Next, among them, remember to add environment variables, as shown in the figure:
Add To Path
until the last step is successfully installed.

To understand the configuration of node cache and global dependencies, please refer to blog npm, node modify configuration npm config and the role of .npmrc files

If it helps, please like and collect~

Guess you like

Origin blog.csdn.net/aaqingying/article/details/125622695