Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python is not a valid npm option

Tags:

npm

npm-config

I am trying to set an older version of python in order to install modules and build an old node project.

I run this command:

npm config set python=python2.7

OR

npm config set python C:\Python27\python.exe

In both cases I am getting this error:

npm ERR! `python` is not a valid npm option 

Nove v16.14.2

Npm v9.1.2

like image 807
reddfox Avatar asked Sep 07 '25 10:09

reddfox


1 Answers

Consider downgrading npm to v8 for now:

npm install -g npm@^8

Alternatively, just run:

npm config edit

and add:

python=C:\Python27\python.exe

in a new line.

like image 123
brc-dd Avatar answered Sep 10 '25 05:09

brc-dd