一、Vue项目构建
2019-06-13 本文已影响0人
chenzhenlindx
-
安装node.js之后 查看是否安装成功并已添加全局变量
node -v
node -v
-
安装nrm
npm install nrm -g
npm install nrm -g
-
选择npm淘宝镜像为默认npm服务器
nrm ls
nrm use taobao
![](https://img.haomeiwen.com/i4321745/c59aa809d9b6d17f.png)
- 全局安装vue-cli 3.x
npm install -g @vue/cli
![](https://img.haomeiwen.com/i4321745/4bfc4a6ce44fd69d.png)
- 创建项目
cd desktop
vue init webpack first-vue
![](https://img.haomeiwen.com/i4321745/2862b83bdbc0e1cb.png)
-
进入项目根目录 安装项目所需依赖
npm install
image.png
-
项目运行
npm run dev
image.png
运行完成后显示:
image.png
在浏览器输入http://localhost:8080/ 即可打开页面
image.png