Search code examples
node.jsreactjscmdjsxnode-sass

Node Sass failing to install


I tried installing Node sass in my react app by running

npm install node-sass

It failed with an error

Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic.

I've tried

  • Removing the node-modules
  • Removing the package-lock.json
  • Runing "npm install"

Still didn't work.


Solution

  • Turns out, my node version is not updated.

    I had to unistall my Node app from the control panel, Download the latest version, and then reinstall.

    Then I re ran my 'npm install' for the node modules.

    This worked for me.