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

DockerFile ARG DEBUG=false gives npm Error npm v10.1.0 is known not to run on Node.js v20.9.0 #50524

Closed
ThatzOkay opened this issue Nov 2, 2023 · 1 comment
Labels
npm Issues and PRs related to the npm client dependency or the npm registry. wrong repo Issues that should be opened in another repository.

Comments

@ThatzOkay
Copy link

Version

v20.9.0

Platform

Microsoft Windows NT 10.0.19045.0 x64

Subsystem

No response

What steps will reproduce the bug?

when running npm -v with ARG DEBUG=false in my DockerFile i get

#19 3.000 ERROR: npm v10.1.0 is known not to run on Node.js v20.9.0. This version of npm supports the following node versions: ^18.17.0 || >=20.5.0. You can find the latest version at https://nodejs.org/.
#19 3.000
#19 3.000 ERROR:
#19 3.005 SyntaxError: Invalid regular expression: /^[$/: Unterminated character class
#19 3.005 at new RegExp ()
#19 3.005 at Function.enable (/usr/lib/node_modules/npm/node_modules/debug/src/common.js:184:28)
#19 3.005 at setup (/usr/lib/node_modules/npm/node_modules/debug/src/common.js:269:14)
#19 3.005 at Object. (/usr/lib/node_modules/npm/node_modules/debug/src/node.js:240:37)
#19 3.005 at Module._compile (node:internal/modules/cjs/loader:1241:14)
#19 3.005 at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
#19 3.005 at Module.load (node:internal/modules/cjs/loader:1091:32)
#19 3.005 at Module._load (node:internal/modules/cjs/loader:938:12)
#19 3.005 at Module.require (node:internal/modules/cjs/loader:1115:19)
#19 3.005 at require (node:internal/modules/helpers:130:18)
#19 ERROR: process "/bin/sh -c npm -v" did not complete successfully: exit code: 1

This is not only with npm -v. I also tried only npm install and still got the same error.
The build gets triggerd from a docker-compose file and renaming or removing theARG DEBUG line makes npm work correctly again

How often does it reproduce? Is there a required condition?

Every time i build my DockerFile from docker-compose

What is the expected behavior? Why is that the expected behavior?

when running the command npm -v to show the version number

What do you see instead?

The error provided saying the version of npm does not work with node

Additional information

No response

@bnoordhuis
Copy link
Member

You can report that over at https://github.com/npm/cli/issues

@bnoordhuis bnoordhuis closed this as not planned Won't fix, can't repro, duplicate, stale Nov 3, 2023
@bnoordhuis bnoordhuis added npm Issues and PRs related to the npm client dependency or the npm registry. wrong repo Issues that should be opened in another repository. labels Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
npm Issues and PRs related to the npm client dependency or the npm registry. wrong repo Issues that should be opened in another repository.
Projects
None yet
Development

No branches or pull requests

2 participants