You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When installing a package with a version range, npm installs the package 'undefined' because it parses the command line arguments wrong.
Expected Behavior
When installing a package with a version range, it should install the requested package at one of the requested versions, preferrably the lowest (IMHO), and not install the undefined package.
Steps To Reproduce
$ mkdir npm-repro
$ cd npm-repro
$ npm i typescript@">=2.0.0 <5.0.0" --verbose
npm i typescript@">=2.0.0 <5.0.0" --verbose
npm verbose cli /home/mwaibel/bin/node-v18.20.3-linux-x64/bin/node /home/mwaibel/bin/node-v18.20.3-linux-x64/bin/npm
npm info using [email protected]
npm info using [email protected]
npm verbose title npm i typescript@>=2.0.0 <5.0.0
npm verbose argv "i" "typescript@>=2.0.0" "<5.0.0" "--loglevel" "verbose"
Note in the line above: "i" "typescript@>=2.0.0" "<5.0.0" – the version ranges got separated.
npm verbose logfile logs-max:10 dir:/home/mwaibel/.npm/_logs/2024-07-24T15_01_15_655Z-
npm verbose logfile /home/mwaibel/.npm/_logs/2024-07-24T15_01_15_655Z-debug-0.log
npm http fetch GET 200 https://npm.global-office.de/undefined 97ms (cache revalidated)
npm http fetch GET 200 https://npm.global-office.de/typescript 811ms (cache updated)
npm http fetch GET 200 https://npm.global-office.de/undefined 27ms (cache updated)
npm warn deprecated [email protected]: this package has been deprecated
npm http fetch POST 200 https://npm.global-office.de/-/npm/v1/security/advisories/bulk 256ms
npm http fetch GET 200 https://npm.global-office.de/typescript/-/typescript-5.5.4.tgz 1112ms (cache miss)
added 2 packages, and audited 3 packages in 2s
found 0 vulnerabilities
npm verbose cwd /home/mwaibel/tmp/npm-repro
npm verbose os Linux 5.10.102.1-microsoft-standard-WSL2
npm verbose node v18.20.3
npm verbose npm v10.8.2
npm verbose exit 0
npm info ok
@mwaibel-go
I tried in Mac as well as WSL for both it's installing correctly. Not able to reproduce your case. If possible Could you please provide a full log file? is it happening with other packages ?
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
When installing a package with a version range, npm installs the package 'undefined' because it parses the command line arguments wrong.
Expected Behavior
When installing a package with a version range, it should install the requested package at one of the requested versions, preferrably the lowest (IMHO), and not install the
undefined
package.Steps To Reproduce
Note in the line above:
"i" "typescript@>=2.0.0" "<5.0.0"
– the version ranges got separated.Environment
; copy and paste output from `npm config ls` here
The text was updated successfully, but these errors were encountered: