1. Download the Node. Js
Node. Js download pageChoose to download
2. Unzip
To decompress the package to your own path, select drive D. Create two folders
- Node-global: indicates the global installation position of NPM
- Node-cache: indicates the NPM cache path
3. Configure environment variables
CMD, which maps the NPM command to node.exe npm-cli.js. So you can execute NPM install in any directory by simply adding the path of Node.exe to the environment variable.
4. Verify
Execute them separately on the command line
node -v
npm -v
If the following version number appears, the installation is complete.
Configure node-global: NPM global installation location and node-cache: NPM cache path. Run the following command:
NPM config set prefix "D:\node-v14.16.0-win-x64\node-global"
NPM config set cache" D:\node-v14.16.0-win-x64\node-cache"
To update the NPM to the latest version, execute the following command:
npm install -g npm
5. Test
The installationWebpack (a static module packaging tool for modern JavaScript applications)To test, execute the following command:
npm install webpack -g
You can see the webpack folder in node_modules under Node-global