Module build failed: Error: Cannot find module 'node-sass'报错问题

重新拉了个项目,运行时,报Module build failed: Error: Cannot find module 'node-sass'

 

原因1:未安装node-sass

  解决: 使用cnpm 安装, 一定得使用cnpm安装,npm安装的还是会报错

// 要先安装cnpm,使用淘宝镜像安装:
npm install -g cnpm --registry=https://registry.npm.taobao.org

cnpm install node-sass --save

原因2: 可能是node版本太高,可试着降低版本到@10

原文地址:https://www.cnblogs.com/zixuan00/p/12738982.html