运行vue项目,没有node-sass引起一系列的问题

首先是:Error: Cannot find module 'node-sass'node

解决办法:npm

1.在项目目录cmd下运行 npm install -g cnpm --registry=https://registry.npm.taobao.orgwindows

2.下载成功后再运行  cnpm install node-sasssass

两个都下载成功后就能够正常的运行项目了。ui

 

而后出现一个又问题:.net

Error: Node Sass version 5.0.0 is incompatible with ^4.0.0.code

 

 

 解决方法:blog

卸载已安装版本 npm uninstall node-sass
安装 npm install node-sass@4.14.1cmd

 

最后出现一个问题:it

 

 

 

 即没有Python环境

 

 

因此解决上面问题的方法和顺序是:

解决办法

1、

一、安装windows-build-tools

npm install --global --production windows-build-tools

二、安装node-gyp

npm install --global node-gyp

先把环境安装上

 

第2、

卸载已安装版本 npm uninstall node-sass

安装 npm install node-sass@4.14.1

 

这样就解决啦

而后npm run dev就好了!!!

参考:

https://blog.csdn.net/wangdong9395/article/details/109457992

https://blog.csdn.net/sliver1836/article/details/95950284

https://blog.csdn.net/qq_39165556/article/details/94590365

相关文章
相关标签/搜索