-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Inconsistent quoting of github dependency names leads to unnecessary lockfile changes #4953
Comments
They are actually different:
The Still stepping through this, but it seems like:
Both code paths pass through |
Digging further... I think this might have something to do with the dependencies being different between the If you look at what the NPM registry returns for However in the downloaded .tgz file's package.json I'm not entirely sure, but I think when there is a cache hit on I'm not really sure where else to go with this one... any help is appreciated. @BYK @kaylieEB do either of you know if this difference in registry vs package.json dependencies is a knows NPM-oddity? |
I think this can be the case all the time. I feel like package.json should take precedence (which I think is what's happening here). That said in that case what we resolve would be different from what we got. Maybe we can simply fail and throw early if we detect this when we download the package and also remove it from the cache? |
In my Expo project, Whenever I ran npm install I got tons of following changes due to inconsistent quotes.
|
@ooooseaoooo Maybe use |
Do you want to request a feature or report a bug?
This seems like a yarn bug.
What is the current behavior?
We've got a certain transitive dependency that is always resolved correctly, but the name of this dependency is sometimes quoted depending on which yarn command was executed last.
If I run
yarn install
in our project,yarn.lock
always ends up containing this (dependency name not quoted):If I run
yarn upgrade
in our project,yarn.lock
always ends up containing this (dependency name quoted):So, even if there are no actual version changes, install and upgrade can cause unnecessary lockfile changes that the other command reverts later. Removing
node_modules
doesn't help.If the current behavior is a bug, please provide the steps to reproduce.
This is reproducible with a barebones
package.json
with these two dependencies:Now, running
yarn upgrade
quotes the axios transitive dependency, andyarn install
reverts the quoting. This seems to have something to do with multiple github dependencies, because ifleft-pad
is removed, both yarn commands use quotes in the axios dependency name. Note thatcontentful
doesn't useleft-pad
even transitively, so just the existence of another github dependency is enough to trigger this behaviour.What is the expected behavior?
yarn.lock
uses consistently either the quoted or non-quoted naming foraxios
, so install/upgrade doesn't do unnecessary quoting modifications to the lock file.Please mention your node.js, yarn and operating system version.
The text was updated successfully, but these errors were encountered: