Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node 18.14.0 regression: npm config set python python3: npm ERR! python is not a valid npm option #6126

Open
2 tasks done
candrews opened this issue Feb 3, 2023 · 6 comments
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue regression:9.x Release 9.x work is associated with a specific npm 9 release

Comments

@candrews
Copy link

candrews commented Feb 3, 2023

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

Running:
npm config set python python3

Results in this error:

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

Expected Behavior

There shouldn't be any error; it should work. See documentation: https://docs.npmjs.com/cli/v9/commands/npm-config?v=true#set

This worked as expected and documented until node 18.14.0, in which version this unexpected behavior began.

Steps To Reproduce

  1. docker run -it --entrypoint /bin/bash node:18.14.0
  2. npm config set python python3 and see the aforementioned error

Environment

  • npm: 9.3.1
  • Node.js: v18.14.0
  • OS Name: any
  • System Model Name: n/a
  • npm config:
; node bin location = /usr/local/bin/node
; node version = v18.14.0
; npm local prefix = /
; npm version = 9.3.1
; cwd = /
; HOME = /root
; Run `npm config ls -l` to show all defaults.
@candrews candrews added Bug thing that needs fixing Needs Triage needs review for next steps Release 9.x work is associated with a specific npm 9 release labels Feb 3, 2023
@agaengel
Copy link

I just ran in an similar issue setting the value tarball with npm 9.3.1

@davidmurdoch
Copy link

Anyone have a workaround other than downgrading npm?

@davidmurdoch
Copy link

davidmurdoch commented Feb 15, 2023

Here is the line that introduced the breaking change: be642c6#diff-9d8a792f1506f5f271be6e040eb80022ba16209ea7888dd8addd068e779b7e36R163

The first version with this breaking change is v9.0.0-pre.6, v9.0.0-pre.5 works as expected.

The breaking change was documented here: https://github.com/npm/cli/releases/tag/v9.0.0

@davidmurdoch
Copy link

cc @wraithgar, @lukekarrys

@davidmurdoch
Copy link

Looks like Node justifies breaking changes in semver minor releases because of a guideline document that exists in the npm/cli repo about the extent to which npm can introduce breaking changes it's its own semver major update?

Anyway, if these changes are to be believed, npm config set python value doesn't do anything? In any event, a deprecation warning well ahead of the removal would have been nice.

@davidmurdoch
Copy link

Looks like the config option is used by node-gyp: https://github.com/nodejs/node-gyp/tree/v9.3.1#configuring-python-dependency

@lukekarrys lukekarrys added Priority 1 high priority issue regression:9.x and removed Needs Triage needs review for next steps labels Feb 15, 2023
cclauss added a commit to nodejs/gyp-next that referenced this issue Aug 26, 2023
* Add Python 3.12 beta 1 to testing

* Use packaging instead of distutils

* Ignore PLR1714 for now

* Add packaging as a dependency

* Install Python dependencies in CI

* Add another install command

* Try setting env var

* Rework pwsh script

* Try using batch

* use npm config set

* Work around npm/cli#6126

* Pass file rather than directory

* Remove gyp-next self-install

* uninstall, not remove

* Add -y

* Ignore the latest lint rules

---------

Co-authored-by: Christian Clauss <cclauss@me.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Priority 1 high priority issue regression:9.x Release 9.x work is associated with a specific npm 9 release
Projects
None yet
Development

No branches or pull requests

4 participants