Node Sass could not find a binding
錯誤示例
error in ./src/components/BaseLayout.vue?vue&type=style&index=0&id=49eec20b&lang=scss&scoped=true&
Module build failed (from ./node_modules/sass-loader/dist/cjs.js):
Error: Missing binding /Users/yunwisdom/Workspace/oa-front-service/node_modules/node-sass/vendor/darwin-x64-64/binding.node
Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 10.x
Found bindings for the following environments:
- OS X 64-bit with Node.js 10.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass` to download the binding for your current environment.
at module.exports (/Users/yunwisdom/Workspace/oa-front-service/node_modules/node-sass/lib/binding.js:15:13)
at Object.<anonymous> (/Users/yunwisdom/Workspace/oa-front-service/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at getDefaultSassImpl (/Users/yunwisdom/Workspace/oa-front-service/node_modules/sass-loader/dist/index.js:198:10)
at Object.loader (/Users/yunwisdom/Workspace/oa-front-service/node_modules/sass-loader/dist/index.js:80:29)
解決方法
npm rebuild node-sass
npm update