1

I have a service that I wrote in Node.js v8.0 And I'm trying to install it on Node.js v18.7.0,

When I try to 'npm install' I get an obscure error.

like this, enter image description here

I tried installing python and setting it in environment variables and it doesn't help..

Does anyone have a solution to this problem?

OrYo
  • 83
  • 1
  • 9
  • 2
    No No No! It has nothing to Python! You need to rebuild `node-sass` using the `npm rebuild node-sass ` command. In case of running into a problem visit: https://stackoverflow.com/questions/53125291/build-fails-npm-rebuild-node-sass-force – Raeisi Aug 10 '22 at 16:03
  • I tried all options : 'npm uninstall node-sass npm i node-sass npm rebuild node-sass'. But it didn't help. still the same error... – OrYo Aug 11 '22 at 05:27
  • 1
    Another guide. Please remove the package from your local node_modules and the global one manually. As you upgrade `Node.Js `, remove the local and the global node_modules entirely. Also clear caches and `package.lock.json`. (Just shitf+delete all of them and retry) – Raeisi Aug 11 '22 at 08:04

2 Answers2

1

Thank you Mr. R. I concentrate here the order of operations in an orderly manner, for the benefit of all:

  1. Reload the project from git and delete package-lock.json file(or remove node_module and delete package-lock.json file , and clear caches)

  2. Run remove Node.js from your computer .

  3. Restart your computer( maybe you don't have to, but that's what I did :( )

  4. Reinstall Node.js.

  5. Run in terminal:

    npm uninstall node-sass

    npm WARN using --force

    npm i node-sass

    npm rebuild node-sass --force

  6. Run: 'npm i'

Successfully

OrYo
  • 83
  • 1
  • 9
0

I got the same error. Tried all suggested answers between this page & this link.

I deleted node_modules & package-lock.json, then entered these commands which got things going, for whatever reason:

  • npm i -g sass
  • npm rebuild node-sass
NicholasKyleHoffman
  • 317
  • 1
  • 4
  • 14