Vue environment construction: installation of node.js and vue scaffolding

1.1 node.js download

Installation of node.js:
The latest version from the official website: https://nodejs.org/en/Historical
version: https://nodejs.org/zh-cn/download/releases/

1.2 Installation process and verification

During the installation process (omitted)
check the node version and npm package management tool version
Insert image description here

1.3 npm source change

You can use npm or cnpm to install vue-cli. cnpm is the domestic mirror source of npm. You can use the command:

# 换源
npm install --registry=https://registry.npm.taobao.org
# 验证
npm config get registry	#输出:https://registry.npm.taobao.org/

(The installation and use of cnpm and nrm will not be introduced here)

1.4 Explanation of npm installation parameters

-g is the global setting
-S --save. The installation package information will be added to dependencies (dependencies in the production phase), and the dependencies will be installed into the project directory (this is commonly used).
-D --save–dev The installation package information will be added to devDependencies (development phase dependencies).

1.4 vue cli installation

# 旧版 npm install -g vue-cli
# 新版
npm install -g @vue/cli
# 查看安装的vue脚手架版本
vue -V

1.5 Check the installation path of dependent packages

npm root -g		# 查看全局依赖包安装位置
npm root		# 查看当前项目依赖包安装位置

1.5 View vue version

vue -V		# 查看vue-cli脚手架版本
npm list vue # 查看vue版本

Supongo que te gusta

Origin blog.csdn.net/qq_38662733/article/details/121633989
Recomendado
Clasificación