npm run serve 报错:Node Sass does not yet support your current environment: Windows 64-bit with Unsupported runtime
原因:node-sass与node版本不匹配
- 卸载node-sass重装
npm uninstall --save node-sass
设置淘宝镜像源
npm config set registry http://registry.npm.taobao.org/
设置变量 sass_binary_site,指向淘宝镜像地址
npm config set sass_binary_site https://npm.taobao.org/mirrors/node-sass/
安装
npm install --save node-sass
若报错:While resolving: eslint-plugin-vue@5.2.3 Found: eslint@6.0.1
在很多情况下,npm版本问题会导致下载冲突,从而中断安装过程
- 解决:在完整的指令后面添加–legacy-peer-deps
npm install --save node-sass --legacy-peer-deps
若继续报错:npm ERR! gyp verb
which
failed Error: not found: python2
依旧是node-sass与node 版本问题,需要修改node版本,通过安装nvm来修改node的版本
注意:安装nvm时不能安装任何node版本(如存在请删除后再安装nvm)