- npm install 报错的情况下可以先清理缓存:
npm cache clean --force
然后升级版本
npm install -g npm
- 安装安装cnpm 绑定淘宝镜像
npm install -g cnpm --registry=http://registry.npm.taobao.org
- 安装依赖
cnpm install
- 如何运行vue项目
查看 package.json 中 其中scripts中有serve
{...
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"clean": "gulp clean",
"buildgulp": "gulp",
"build:image": "gulp image",
"build:css": "gulp css",
"build:js": "gulp js",
"build:html": "gulp html",
"build:others": "gulp others",
"watch": "gulp watch"
}
}