Vue environment preparation - nodejs, npm

Vue environment preparation


First of all, you need to clarify what the following three things are used for:

  • npm : package manager under Nodejs
  • webpack: Its main purpose is to make corresponding preparations for all static resources that need to be released on the browser side through the syntax of CommonJS, such as merging and packaging of resources
  • vue-cli : user generated Vue project template

nodejs download and installation

First go to the official website to download.
1
After the download is complete, double-click to install:
2
3
4
5
6
Check whether the installation is successful:
7

configuration

The local warehouse of npm will be on the C drive by default, so we need to change the configuration.
Create two new folders under the nodejs installation directory:
8
Then execute the following two instructions:

npm config set prefix "D:\softwares\Study\NodeJS\node_global"
npm config set cache "D:\softwares\Study\NodeJS\node_cache"

In order to improve the download speed, you can configure a mirror station:

npm config set registry=http://registry.npm.taobao.org    #配置镜像站
npm config get registry     #检查一下有没有配置好

10
Open the .npmrc file under C:\Users\Administrator, you can see the configuration information we just had:

11

Note: The default module D:\softwares\Study\NodeJS\node_modules path will be changed to D:\softwares\Study\NodeJS\node_global\node_modules, so we need to configure the environment variables:
12

Guess you like

Origin blog.csdn.net/qq_42757191/article/details/123444654