1
votes

I am trying to serve my ionic project. but when i run ionic serve it give me the following error!

Module build failed (from ./node_modules/sass-loader/lib/loader.js): [ng] Error: Missing binding /home/gideon/node_modules/node-sass/vendor/linux-x64-57/binding.node

I have tried to run "$ npm rebuild node-sass" but it stii gave me error. I also deleted the node-sass folder and ran again "$npm install" but still not going and returning the same error.


ERROR in ./src/global.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/global.scss)
[ng] Module build failed (from ./node_modules/sass-loader/lib/loader.js):
[ng] Error: Missing binding /home/gideon/node_modules/node-sass/vendor/linux-x64-57/binding.node
[ng] Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x
[ng] 
[ng] Found bindings for the following environments:
[ng]   - Linux 64-bit with Node.js 10.x
[ng] 
[ng] This usually happens because your environment has changed since running `npm install`.
[ng] Run `npm rebuild node-sass` to download the binding for your current environment.
[ng]     at module.exports (/home/gideon/node_modules/node-sass/lib/binding.js:15:13)
[ng]     at Object.<anonymous> (/home/gideon/node_modules/node-sass/lib/index.js:14:35)
[ng]     at Module._compile (module.js:653:30)
[ng]     at Object.Module._extensions..js (module.js:664:10)
[ng]     at Module.load (module.js:566:32)
[ng]     at tryModuleLoad (module.js:506:12)
[ng]     at Function.Module._load (module.js:498:3)
[ng]     at Module.require (module.js:597:17)
[ng]     at require (internal/module.js:11:18)
[ng]     at Object.sassLoader (/home/gideon/IONIC/ionic-news-app-master/node_modules/sass-loader/lib/loader.js:46:72)
[ng] ERROR in ./src/theme/variables.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/theme/variables.scss)
[ng] Module build failed (from ./node_modules/sass-loader/lib/loader.js):
[ng] Error: Missing binding /home/gideon/node_modules/node-sass/vendor/linux-x64-57/binding.node
[ng] Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x
[ng] 
[ng] Found bindings for the following environments:
[ng]   - Linux 64-bit with Node.js 10.x
[ng] 
[ng] This usually happens because your environment has changed since running `npm install`.
[ng] Run `npm rebuild node-sass` to download the binding for your current environment.
[ng]     at module.exports (/home/gideon/node_modules/node-sass/lib/binding.js:15:13)
[ng]     at Object.<anonymous> (/home/gideon/node_modules/node-sass/lib/index.js:14:35)
[ng]     at Module._compile (module.js:653:30)
[ng]     at Object.Module._extensions..js (module.js:664:10)
[ng]     at Module.load (module.js:566:32)
[ng]     at tryModuleLoad (module.js:506:12)
[ng]     at Function.Module._load (module.js:498:3)
[ng]     at Module.require (module.js:597:17)
[ng]     at require (internal/module.js:11:18)
[ng]     at Object.sassLoader (/home/gideon/IONIC/ionic-news-app-master/node_modules/sass-loader/lib/loader.js:46:72)
[ng] ERROR in ./src/app/home/home.page.scss
[ng] Module build failed (from ./node_modules/sass-loader/lib/loader.js):
[ng] Error: Missing binding /home/gideon/node_modules/node-sass/vendor/linux-x64-57/binding.node
[ng] Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 8.x
[ng] 
[ng] Found bindings for the following environments:
[ng]   - Linux 64-bit with Node.js 10.x
[ng] 
[ng] This usually happens because your environment has changed since running `npm install`.
[ng] Run `npm rebuild node-sass` to download the binding for your current environment.
[ng]     at module.exports (/home/gideon/node_modules/node-sass/lib/binding.js:15:13)
[ng]     at Object.<anonymous> (/home/gideon/node_modules/node-sass/lib/index.js:14:35)
[ng]     at Module._compile (module.js:653:30)
[ng]     at Object.Module._extensions..js (module.js:664:10)
[ng]     at Module.load (module.js:566:32)
[ng]     at tryModuleLoad (module.js:506:12)
[ng]     at Function.Module._load (module.js:498:3)
[ng]     at Module.require (module.js:597:17)
[ng]     at require (internal/module.js:11:18)
[ng]     at Object.sassLoader (/home/gideon/IONIC/ionic-news-app-master/node_modules/sass-loader/lib/loader.js:46:72)
[ng] ℹ 「wdm」: Failed to compile.

PLEASE I REALLY NEED HELP! SOMEONE TO HELP ME ! THANKS IN ADVANCE!

2
What version of node-sass is used? I had the same issue with 4.10.0 and I've updated to 4.12.0 and it solved itMonomachus

2 Answers

1
votes

Steps to solve problem Run

npm rebuild node-sass

to build the binding for your current environment.

1
votes

Try this

rm -r node_modules
rm package-lock.json
npm install --save-dev node-sass ***or*** npm rebuild node-sass --force
npm install