天天看點

node更新版本後sass無法編譯解決辦法

npm install node-sass:出現錯誤

Error: ENOENT: no such file or directory, scandir '/Users/haoxiaojun/xfs-git/fecode/workdesk/vue-h5/node_modules/node-sass/vendor'
    at Error (native)
    at Object.fs.readdirSync (fs.js::)
    at Object.getInstalledBinaries (/Users/haoxiaojun/xfs-git/fecode/workdesk/vue-h5/node_modules/node-sass/lib/extensions.js::)
    at foundBinariesList (/Users/haoxiaojun/xfs-git/fecode/workdesk/vue-h5/node_modules/node-sass/lib/errors.js::)
    at foundBinaries (/Users/haoxiaojun/xfs-git/fecode/workdesk/vue-h5/node_modules/node-sass/lib/errors.js::)
    at Object.module.exports.missingBinary (/Users/haoxiaojun/xfs-git/fecode/workdesk/vue-h5/node_modules/node-sass/lib/errors.js::)
    at module.exports (/Users/haoxiaojun/xfs-git/fecode/workdesk/vue-h5/node_modules/node-sass/lib/binding.js:15:30)
    at Object.<anonymous> (/Users/haoxiaojun/xfs-git/fecode/workdesk/vue-h5/node_modules/node-sass/lib/index.js::)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/haoxiaojun/xfs-git/fecode/workdesk/vue-h5/node_modules/sass-loader/lib/loader.js::)
           

解決方法:

npm rebuild node-sass
           

繼續閱讀