Reputation: 3447
I have gone through all the questions regarding this issue but I cannot seem to find anything that works.
I am getting this error :-
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: `node scripts/build.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
I have tried to remove the node_modules and npm install again. I also tried to remove the node-sass folder in the node_modules and npm install -g node-sass@latest did not work too. I also tried
npm install -g node --unsafe-perm=true --allow-root
and
npm uninstall node-sass
npm cache clean --force
npm install -g node-sass@latest
but nothing seems to be working at all. Is there someone who can shed some light on this please?
Thanks for your time
Upvotes: 16
Views: 33764
Reputation: 449
Following steps worked for me.
sudo npm install -g --unsafe-perm node-sass
npm install
without sudo command.Upvotes: 1
Reputation: 9
This is because of your incompatible node version with the node-sass module by the way node-sass is deprecated. check this link and select the best version with your node installed https://www.npmjs.com/package/node-sass
Upvotes: 0
Reputation: 551
try this command it should work successfully
sudo npm install -g --unsafe-perm node-sass
it work for me
Upvotes: 2
Reputation: 6329
Unless you're working on some sort of shared project that has strict requirements you can do the following to overcome the issue:
1.) Delete your package.lock
file - which indicates the versions to be locked at.
2.) Delete your node_modules
folder which contains all the original installations and C++ binary compilations.
3.) Then npm install
it all back and npm rebuild
for good measure.
Upvotes: 17
Reputation: 1892
It looks like this is documented on the Node-Sass page in NPM. Upgrade to Node-Sass v 4.12.0 and it will work with Node 12.
Upvotes: 4
Reputation: 3447
After battling with this issue for a considerable amount of hours, I downgraded from the Current version of Node (12.8.0) to the LTS (10.16.2) and it finally worked. So if you are having issues like mine, maybe try to downgrade the node version and it can help you
Upvotes: 0