-
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
Clearer documentation around yarn install / --frozen-lockfile / --pure-lockfile #5847
Comments
A closely related problem is the lack of documentation on when the yarn.lock is generated and/or modified. There's the The This is probably the most important feature of |
Also good to clarify: Is there ever a situation where As far as I can tell, This could definitely be clearer. And if they do the same thing, I propose saying one is an alias of the other. Otherwise, the distinction between them should be made more obvious. |
This is my observation, which seems to defeat the whole purpose of having a lock file. As far as I can discern, I don't think the lock file does anything useful because none of the available options do what we really want...which is to just install the versions listed in the lock file, don't fail, and don't touch the lock file. If there is such an option, I'd be very glad to learn about it. |
Do those options ressemble |
So, here is what I have found, in practical terms. Tested with yarn 1.17.3.
[Edit: A bunch of weird behavior I initially described here was due to copy-pasting garbled data. If anyone is still curious about that (now admittedly minor) issue, see: #7594 ] |
@Telokis you probably want Having read the docs for
So I guess you may want to do: rm -rf node_modules
yarn install --frozen-lockfile Edit to add: And otherwise proceeds as if there is no problem. This is unlike
So if that is important to you, you can do if [ -e yarn.lock ]; then
rm -rf node_modules
yarn install --frozen-lockfile
else
false # This command exits with status 1 for "error"
# alternatively, do this:
# exit 1 # which may quit the CI script entirely, with exit status 1 for "error"
fi |
Since this issue was opened, the following PR has landed to clarify the docs: yarnpkg/website#884 I think that does a pretty good job of explaining it. The new text can be read here: https://yarnpkg.com/en/docs/cli/install#toc-yarn-install |
This patch adds `--frozen-lockfile` to our regular `yarn install` calls during manual set up. This should ensure people get the expected versions and not any newer or older versions that might behave unexpectedly. References: yarnpkg/yarn#5847 (comment) https://classic.yarnpkg.com/en/docs/cli/install#toc-yarn-install-frozen-lockfile Signed-off-by: Sheogorath <[email protected]>
This patch adds `--frozen-lockfile` to our regular `yarn install` calls during manual set up. This should ensure people get the expected versions and not any newer or older versions that might behave unexpectedly. References: yarnpkg/yarn#5847 (comment) https://classic.yarnpkg.com/en/docs/cli/install#toc-yarn-install-frozen-lockfile Signed-off-by: Sheogorath <[email protected]>
Documentation is not clear when explaining installing yarn packages without editing the yarn.lock file. I am still confused between yarn install --frozen-lockfile and --pure-lockfile.
Currently
For both of these options there needs to be better documentation e.g.
Only through much googling did I understand that yarn install was editing yarn.lock and these commands prevented it.
The text was updated successfully, but these errors were encountered: