Upgrade to the v8 ^ above to the environment of the node, the node-sass error solution
Today, I upgraded the system of my colleague’s computer and also upgraded all the software. I found that there was an error in the original project. The general error message is as follows:
ERROR Failed to compile with 1 errors PM 1:56:26
error in ./src/components/Hello.vue
Module build failed: Error: Missing binding /Users/fungleo/Sites/MyWork/vuedemo2/node_modules/node-sass/vendor/darwin-x64-57/binding.node
Node Sass could not find a binding for your current environment: OS X 64-bit with Node.js 8.x
Found bindings for the following environments:
- OS X 64-bit with Node.js 6.x
This usually happens because your environment has changed since running `npm install`.
Run `npm rebuild node-sass --force` to build the binding for your current environment.
at module.exports (/Users/fungleo/Sites/MyWork/vuedemo2/node_modules/node-sass/lib/binding.js:15:13)
at Object.<anonymous> (/Users/fungleo/Sites/MyWork/vuedemo2/node_modules/node-sass/lib/index.js:14:35)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/fungleo/Sites/MyWork/vuedemo2/node_modules/sass-loader/lib/loader.js:3:14)
at Module._compile (module.js:635:30)
at Object.Module._extensions..js (module.js:646:10)
at Module.load (module.js:554:32)
at tryModuleLoad (module.js:497:12)
at Function.Module._load (module.js:489:3)
at Module.require (module.js:579:17)
@ ./~/vue-style-loader!./~/css-loader?{"minimize":false,"sourceMap":false}!./~/vue-loader/lib/style-compiler?{"vue":true,"id":"data-v-2d1bdf0c","scoped":false,"hasInlineConfig":false}!./~/sass-loader/lib/loader.js?{"sourceMap":false}!./~/vue-loader/lib/selector.js?type=styles&index=0!./src/components/Hello.vue 4:14-394 13:3-17:5 14:22-402
@ ./src/components/Hello.vue
@ ./src/router/index.js
@ ./src/main.js
@ multi ./build/dev-client ./src/main.js
> Listening at http://localhost:8080
This code was copied on my computer after I upgraded Node. But that’s the general idea, depending on the location of the project and so on, it will be different.
node-sass
not compatible with n>v8
version> That’s easy to solve. Execute under the current project
npm i node-sass -D
Then the project went back to normal.
When the project error, do not worry, carefully look at the error code, it is not possible to use the translation tool to translate. Generally speaking, a solution can be found quickly.
This article by Fungleo original, allow to reprint, but reprint must retain the first link.
Read More:
- How to Fix Webpack run error webpack dev server
- [Solved] Vue cli version is @ Vue/cli 4.5.13, and sass is used to report an error
- How to Fix the common Warning Errors after Vue Project Startup
- NPM start project error: cannot find module ‘webpack’ problem solution
- [Solved] gulp-sass Package scss Files Error: Error in plugin “gulp-sass“Message:
- Module not found: Error: Can‘t resolve ‘sass-loader‘ in…
- Module build failed: Error: Node Sass version 6.0.0 is incompatible with ^4.0.0
- [Solved] Gulp-sass Install Error: error: cannot find module ‘sass‘
- [Solved] npm install sass@~1.32 sass-loader deepmerge -D Install Error
- NPM run dev Error Module build failed: Error: Cannot find module ‘node-sass’
- Vue require Error: node_modules/babel-loader/lib
- How to Solve Project Upgrade to flutter2.5.0 Error
- When starting Vue project: cannot find module ‘webpack cli / bin / config yargs’ error resolution
- Some problems encountered in the initial construction of Ant Design Pro project, such as cross Env, webpack and so on
- Module not found: Error: Can‘t resolve ‘sass-loader‘
- How to Solve Error: Module did not self-register
- How to Solve Webpack CacheGroups Error
- json-server Error: EPERM: operation not permitted, mkdir ‘C:\Progra m Files\nodejs\node_
- How to Solve webpack -v View Error in vsode