Node14.15.1 green version configuration, as well as the initialization and startup of the project

1. Download on the official website

https://nodejs.org/zh-cn/download/

2. Download interface

3. The path after decompression (configure according to your own path)

Add root path to paht

 

Note: The node_global configuration is added. When using vue init webpack xxx, it will report an error that the vue command cannot be found. Add this configuration and the vue command can be found (configured after 5.1 or 5.2)

4. After configuration, open cmd to view the version of node and npm

node -v #分别查看node
npm -v #npm的版本号

5. Modify the configuration

5.1 Replace the path to install the global module node_global and cache node_cache

npm config set prefix "E:\software\node\node-v14.15.1-win-x64\node_global"
npm config set cache "E:\software\node\node-v14.15.1-win-x64\node_cache"
npm config set registry https://registry.npm.taobao.org/

5.2 Or use the following method C: Users\Administrator\.npmrc

prefix="E:\software\node\node-v14.15.1-win-x64\node_global"
cache="E:\software\node\node-v14.15.1-win-x64\node_cache"
registry="http://registry.npm.taobao.org/"

6. Installation dependencies (scaffolding, packaging plug-in webpack, cnpm instead of npm download, etc.)

#安装vue.js
npm install vue -g
#安装vue-route
npm install vue-router -g
#安装vue-cli脚手架
npm install vue-cli -g
#安装webpack
npm install webpack -g
#使用yarn替换npm下载
npm install -g yarn
#安装cnpm
npm install -g cnpm

7. Initialize the project

7.1. Create the first project of the project

vue init webpack  "项目名称"
1、Project name //项目名称
2、Project description A Vue.js project //项目的描述,默认的
3、Author *@qq.com //默认,回车即可
4、Vue build (Use arrow keys) //默认,回车即可
5、Vue build standalone //默认,回车即可
6、Install vue-router? No //是否安装路由
7、Use ESLint to lint your code? Yes //是否用ESLint来规范我们的代码
8、Set up unit tests No //是否使用自动化的测试工具
9、Setup e2e tests with Nightwatch? No //使用nightatch设置E2E测试
10、Should we run npm install for you after the project has been created? (recommended) npm //选择npm安装

7.2. Installation dependencies (enter the root path of the project, and then execute the installation command)

cnpm install

7.3、Run the project

npm run dev

 

Guess you like

Origin blog.csdn.net/www1056481167/article/details/112449138