I'm running sudo npm run build
and it says that it cannot find binding for sass. I have currently installed only one version of npm and it's 11.13.0
I tried
npm install node-sass
,
npm rebuild node-sass
,
npm uninstall -save node-sass
,
npm install -save node-sass
,
npm cache clean
, removing competely node and node_modules folders, but still getting the same error. I did however have had version 8.0.0 installed, but I removed it using nvm
ERROR in ./src/main/webapp/styles/styles.scss (./node_modules/@angular-devkit/build-angular/src/angular-cli-files/plugins/raw-css-loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/sass-loader/lib/loader.js??ref--14-3!./src/main/webapp/styles/styles.scss)
Module build failed (from ./node_modules/sass-loader/lib/loader.js):
Error: Missing binding /home/dev/IdeaProjects/web-project/node_modules/node-sass/vendor/linux-x64-57/binding.node
Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x
Found bindings for the following environments:
- Linux 64-bit with Node.js 11.x
If you need any additional information please let me know.
This is due to a mismatch between the version of node used in your project and what you have globally installed.
npm clean-install
within your project directorynpm install
to install all packages againnode -v
to determine which version of node you have active. If the version outputted matches the version you set in the project your npm run build
command will work. If they don't match you will either have to install the matching version of node or if you are using nvm use the: nvm use <version>
to active the matching version.