Leff7's avatar
Level 4

Npm rebuild node-sass fails

I have an old project that has a grunt as build tool. I have installed the project dependencies and grunt cli. This is the package.json file:

{
  "name": "",
  "version": "0.0.1",
  "devDependencies": {
    "grunt": "~0.4.1",
    "grunt-contrib-watch": "~0.5.3",
    "grunt-sass": "^1.0.0",
    "node-sass": "^3.3.3"
  }
}

On trying to run grunt I got an error that I need to run npm rebuild node-sass, but I got a new error then:

npm ERR! Failed at the [email protected] postinstall script 'node scripts/build.js'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the node-sass package, npm ERR! not with npm itself.

I have even tried with running the command with the --force flag. But that didn't work either, how can I fix this?

0 likes
3 replies
jsterj's avatar

I'm having a similar with node-sass when running npm install the first time. Did you ever figure yours out?

spyworld's avatar

Delete the node_modules folder and npm install again. Everything you upgrade the nodejs version, you require to reinstall node sass again.

If fails to rebuild again, you must choose the right nodejs version. I recommended to use version 8

Please or to participate in this conversation.