-
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
Yarn install ignores lockfile #3241
Comments
I can't reproduce this behavior: YARN=yarn
ISSUE=3241
rm -rf /tmp/yarn-issue-$ISSUE
mkdir -p /tmp/yarn-issue-$ISSUE
cd /tmp/yarn-issue-$ISSUE
printf '{ "license": "MIT", "dependencies": { "left-pad": "^1.1.0" } }' > package.json
printf 'left-pad@^1.1.0:\n version "1.1.0"\n resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.1.0.tgz"\n' > yarn.lock
$YARN install |:
$YARN list
rm -rf /tmp/yarn-issue-$ISSUE
mkdir -p /tmp/yarn-issue-$ISSUE
cd /tmp/yarn-issue-$ISSUE
printf '{ "licensde": "MIT", "dependencies": { "left-pad": "^1.1.0" } }' > package.json
printf 'left-pad@^1.1.0:\n version "1.1.1"\n resolved "https://registry.yarnpkg.com/left-pad/-/left-pad-1.1.1.tgz"\n' > yarn.lock
$YARN install |:
$YARN list
printf '{ "license": "MIT", "dependencies": { "left-pad": "^1.1.0", "right-pad": "^1.0.0" } }' > package.json
$YARN install |:
$YARN list |
I don't know what else there is to really tell except it installed different versions of packages than what's defined in the lockfile and then updated the lockfile. The package |
Can you update the script I provided above so that we can reproduce the issue on our side? Without repro, we won't be able to do much. |
Is this the same issue I open here |
The only way I've come close to reproducing this is if I edit my package.json file then re-run For example:
But that scenario makes sense because the "key" into the lock file is the package name and version:
So changing the version range in the package.json would make it no longer find the entry in the lockfile. It is unclear what @alanondra did to produce this error though. @bestander Without reproduction steps, I suggest we close this issue for now, or mark it as a duplicate of #3252 until repro steps are added. |
I was working on a project some months ago and had to step away while I built a new computer. When I came back to the project I cloned my repository and just ran I'll try to post the package.json and yarn.lock files where the issue comes up later today. |
Do you want to request a feature or report a bug?
bug
What is the current behavior?
When running
yarn install
it ignores the lockfile entirely and updates all packages.What is the expected behavior?
Installing only the versions of packages listed in the lockfile. Since there is no documentation on forcing it to abide I hoped this was the expected default behavior.
Please mention your node.js, yarn and operating system version.
Yarn v0.23.2
Windows 7 x64
The text was updated successfully, but these errors were encountered: