- 安装node.js,自行搜索下载(http://nodejs.cn/),建议安装稳定的装版本。
- 安装完node.js会附带安装npm(包管理工具),命令提示符里 npm -v 能显示版本则npm安装成功。通过npm install npm -g进行npm的升级。
- 查看当前镜像: npm config get registry 默认镜像:https://registry.npmjs.org/
不是淘宝的,更换为淘宝镜像
更换镜像: npm config set registry https://registry.npm.taobao.org
- cd进入该目录下(例如 cd D:/workspace/MyProject)。
- npm install
- npm run dev运行项目
发布上线的时候(开发环境不用跑):npm run build
下载和运行(使用yarn依赖管理工具的情况下)
拉取项目代码
git clone https://gitee.com/XXX.git
cd XXX
安装node.js
切换到XXX文件夹下
# 安装yarn
npm install -g yarn
设置为淘宝镜像
yarn config set registry https://registry.npm.taobao.org/
查询当前镜像
yarn config get registry
黑色窗口的 cmd
# 下载依赖
yarn install
# 启动
yarn run serve