-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BUG] Invalid semver in package history causes crash when installing a package #5017
[BUG] Invalid semver in package history causes crash when installing a package #5017
Comments
@bjorn-stange-expel we have the exact same problem 🤔 did you find a workaround without adding The real problem for us is, that some sub-dependency of a sub-dependency (you know heaviest objects in the universe -> node_modules 😉) is pulling in |
Same for me starting with a package sub-dependency Log:
node v16.15.0 |
That's how we're pulling in |
@bjorn-stange-expel I installed the package npm-why to understand where
At least I know now which package it is and I reported this problem to them as well. Maybe they can remove or switch the package somehow. Let's see what they think :-) |
You can also run |
|
I opened a PR at I applied the patch on my local npm install, and it works fine. Hope this helps. |
Wow thanks! |
I applied also the patch and It works like a charm ! |
This is still not fixed, see #5102 which actually merges the patch in npm/cli. |
The fix has beenmerged and released in v8.13.2 |
Are there any plans to backport this to NPM 7 (where audit is also turned on by default)? |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
Installing a package with an invalid semver in its version history causes npm to crash. I wasn't sure if this was a bug with https://github.com/npm/metavuln-calculator or here (or somewhere else), but I thought I'd open the issue here first, since the maintainers probably know best where this bug belongs.
Using
--no-audit
causes the installation to succeed, so what seems like is happening is that package audit happens on install, not just for the version being installed, but for all versions of the package. Since theyui
package has an invalid semver in its version history, when the package audit step iterates over all versions, it causes a crash. This is my guess, and I'm opening an issue here to confirm that this is the case.After running
npm i yui@3.18.1
here's the error:And the relevant debug log:
Expected Behavior
npm i yui@3.18.1
should succeed and not crash npm.Steps To Reproduce
npm i yui@3.18.1
npm ERR! Invalid Version: 3.5.0pr2
Environment
The text was updated successfully, but these errors were encountered: