DockerFile ARG DEBUG=false gives npm Error npm v10.1.0 is known not to run on Node.js v20.9.0 #50524
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.
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
The text was updated successfully, but these errors were encountered: