Cannot find module 'node-sass'

报错信息如下:

[error] ./client/styles/common.scss
Module build failed: Error: Cannot find module 'node-sass'
    at Function.Module._resolveFilename (module.js:470:15)
    at Function.Module._load (module.js:418:25)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.sassLoader (/usr/local/yapi/vendors/node_modules/sass-loader/lib/loader.js:24:22)
 @ ./client/index.js 7:0-31

解决办法:

npm install node-sass

若安装过程中出现Permission denied错误,则用如下命令安装:

npm install node-sass --unsafe-perm=true --allow-root

 

posted @ 2019-01-29 19:38  ycyzharry  阅读(10041)  评论(0编辑  收藏  举报