Reference: https://www.jianshu.com/p/c658e4d27bc9
Pay attention to the date: the version of many tutorials is very low, and some commands are outdated, so write it again
- Download nodejs and install
Link: https://nodejs.org/en/, download the stable version, msi type installation package,
modify the installation location by yourself, it is recommended to install it on a disk other than the C disk, to prevent the occupation of the C disk,
do not check in the middle
- Configure npm package path
To reduce the occupation of the C drive,
create new node_cache and node_global folders under the D:\Program Files\nodejs installation path, open the cmd window, and configure the package path.
npm config set cache "D:\Program Files\nodejs\node_cache"
npm config set prefix "D:\Program Files\nodejs\node_global"
- Modify environment variables
Modify the path of the environment variable. The default path of msi installation is in the C drive. After configuring the path of the npm package, you need to modify it again. Configure the
following system variables with the same content
and then restart the computer! Reboot to enable new system variables
- install cnpm
Depending on your needs, the npm warehouse is located abroad, and the speed is relatively slow. You can use the officially recommended cnpm command line tool to replace the default npm.
npm install --location=global cnpm --registry=https://registry.npm.taobao.org
- configure --location=global
The above command was originally -g, but there will be warnings, use –location=global to solve it.
In addition, modify the contents of the four files according to the blog .
- install vue
Use cnpm as needed
npm install --location=global @vue/cli
- test-vue
Close the above window, reopen a window, enter to
vue -v
view the version ,
enter it in the project directoryvue create hello
, and test the official routine according to the instructions