VUE construction and use—2022/7/12

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

  1. 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

  1. 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"
  1. 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
environment variable

  1. 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

  1. 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 .

  1. install vue

Use cnpm as needed

npm install --location=global @vue/cli
  1. test-vue

Close the above window, reopen a window, enter to vue -vview the version ,
enter it in the project directory vue create hello, and test the official routine according to the instructions

Guess you like

Origin blog.csdn.net/Hot_Ant/article/details/125738586