Open alt-jero opened 1 year ago
@alt-jero I am not able to reproduce this with given steps for public packages like lodash or underscore, I think this is because I am using correct version, but I see the pacakge name is undefined when I am using range outside of correct range.
~/workarea/rep $ npm install jashkenas/underscore#semver:^1.13.1
added 1 package, and audited 2 packages in 9s
found 0 vulnerabilities
~/workarea/rep $ npm -v
9.7.1
~/workarea/rep $ npm ls
rep@1.0.0 /Users/milaninfy/workarea/rep
└── underscore@1.13.6 (git+ssh://git@github.com/jashkenas/underscore.git#bd2d35c87620a7da36250a006c97fdae89f4902d)
~/workarea/rep $ npm install lodash/lodash
added 1 package, and audited 3 packages in 18s
found 0 vulnerabilities
~/workarea/rep $ npm ls
rep@1.0.0 /Users/milaninfy/workarea/rep
├── lodash@5.0.0 (git+ssh://git@github.com/lodash/lodash.git#a67a085cc0612f5b83d78024e507427dab25ca2c)
└── underscore@1.13.6 (git+ssh://git@github.com/jashkenas/underscore.git#bd2d35c87620a7da36250a006c97fdae89f4902d)
Hi Milaninfy!
Thanks for getting back to me!
I think.... If it's working for you with public packages, it may be that something about my specific packages is not correct or at least not setup the way NPM expects.
I can't do it just now, but I will try with the same package you mentioned to see if that one works for me as intended.
If so, then I'll know it's my repo with the issue and not NPM.
If not, I'll need to gather some more info and perhaps create a runnable example somehow.
Also I have a new laptop with a different OS version (and possibly a different NPM version at this point), so I'll try the tests on that one too.
error message shows undefined for package name if the version does not exist. Reproducible on 10.8.1
~/workarea/rep $ npm install jashkenas/underscore#semver:^11.13.1
npm error code ETARGET
npm error notarget No matching version found for undefined@^11.13.1.
npm error notarget In most cases you or one of your dependencies are requesting
npm error notarget a package version that doesn't exist.
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Package name reads 'undefined' in ENOVERSIONS error when dependency is a git(hub) package.
Probably the 'undefined' is referring to the name field of the package.json, which hasn't been fetched because the requested version tag was not found.
Expected Behavior
'Method' references "Steps to Reproduce".
For method 1: Use the URL specified in the command (without the semver hash)
For method 2: Use the name specified in package.json of the host
Also, a short explanatory text might go a long way:
Steps To Reproduce
Setup:
1.0.0
but no git version tags.npm init
it.Method 1: CLI
npm i <your github username>/the-dependency#semver:~1.0.0
Method 2: package.json
"your-test-package": "<your github username>/the-dependency#semver:~1.0.0"
to the package.json of the hostnpm i
Environment
9.7.1
v18.8.0
macOS Big Sur (11.7.7)
MacBook Air (mid-2013)
//registry.npmjs.org/:_authToken = (protected)
; node bin location = /usr/local/bin/node ; node version = v18.8.0 ; npm local prefix = /Users/jero/dev ; npm version = 9.7.1 ; cwd = /Users/jero/dev ; HOME = /Users/jero ; Run
npm config ls -l
to show all defaults.