vue2.0+vant创建项目
- npm -v
- vue -V
- npm install -g vue-cli 全局安装脚手架
- npm install -g vue-cli --registry=https://registry.npm.taobao.org 安装淘宝镜像
- vue init webpack 项目名字
- cd 项目名字
- npm install
- npm i vant -S 安装vant
- npm i babel-plugin-import -D 按需加载
- npm install --save-dev sass-loader 安装sass
- npm install --save-dev node-sass
安装node-sass的时候报错了
原因是因为sass-loader安装的版本太高
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-sass@7.0.0 postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-sass@7.0.0 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\jiaojiemiao.CTX\AppData\Roaming\npm-cache\_logs\2021-12-17T08_46_17_918Z-debug.log
所以后来安装sass-loader@7.3.1和node-sass@4.13.1版本
npm install sass-loader@7.3.1 --save-dev
npm install node-sass@4.14.1 --save-dev
- npm run dev