OrYo
OrYo

Reputation: 193

Npm error : " find Python Python is not set from command line or npm configuration "

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?

Upvotes: 5

Views: 14005

Answers (2)

NicholasKyleHoffman
NicholasKyleHoffman

Reputation: 347

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

Upvotes: 2

OrYo
OrYo

Reputation: 193

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

Upvotes: 2

Related Questions