Downloading the installation file
Download address
The installation files
- After downloading, double-click “node-v8.10.0-x64.msi” to install nodejs. The custom installation is under D:\dev\nodejs. (The even-numbered version is the stable version, the odd-numbered version is the advanced version, the developer version.)
- On the CMD console, enter: node -v. The console displays: v8.10.0. If the version is displayed, the installation is successful.
- This boot step installs the node.exe file into the D: dev nodejs\ directory and adds that directory to the PATH environment variable.
- Since the new nodeJS version already integrates NPM, NPM was installed as well. You can also use the CMD command line to enter “NPM -v” to test whether the installation is successful. If the following figure shows the version, the installation is successful.
- The normal NodeJS setup is now complete. If you need to go into node development mode, enter the first sentence of your NodeJS: “Hello world” – enter console.log(‘ Hello world’).
Installation Environment
- We need to configure the NPM global module storage path and cache path, for example, I want to put the above two folders in the NodeJS home directory, then create two folders “node_global” and “node_cache” under NodeJS
- To start CMD, type:
npm config set prefix"D:\ProgramFiles\nodejs\node_global
npm configset cache"D:\Program Files\nodejs\node_cache
- Now you can install the module:
npm install vue
- By default, the above components are installed in the d: Program Files\nodejs\node_global folder. By default, the d: Program Files\nodejs\node_modules folder is also the automatic lookup path for nodejs-related components.
- Close CMD, open system dialog box, “My computer” right click “Properties” – “Advanced System Settings” – “Advanced” – “Environment Variables”.
- Go to the environment variables dialog box, create “NODE_PATH” under system variables, and type “D:\Program Files\nodejs\node_global\node_modules”.
- The default address of the module is changed, so the user variables above will be changed (the user variable “PATH” will be changed to “D:\Program Files\nodejs\node_global\”). Otherwise, the error XXX is not an internal or external command, a runnable program or batch file will be displayed when the module is not used.
- Note: all commands are installed globally by -g, so that the installed installation package is under the current user, all other places on the disk can be accessed, compare aspects. Otherwise, it can be used only in the current directory.