Do you want to request a feature or report a bug?
I'd consider this a behavior change or bug.
What is the current behavior?
When I run yarn install --frozen-lockfile with an out-of-date lockfile, I get an error message after the "Resolving packages" step. Then I get an exit code of 0, indicating success.
As a consequence of this, our CI system does not fail the build when the package.json file has been changed but the yarn.lock file has not been updated accordingly.
If the current behavior is a bug, please provide the steps to reproduce.
git clean -xdf)yarn installyarn install --frozen-lockfileecho $? to check that the exit code is 0What is the expected behavior?
Whenever I run yarn install --frozen-lockfile and get an error message due to the lockfile being out-of-date, I get a non-zero error code.
Please mention your node.js, yarn and operating system version.
Node: v6.2.2
Yarn: 0.19.1
Operating system: Mac OS X 10.11.6
Bash workaround:
set -o pipefail
yarn_output=$(yarn install --frozen-lockfile 2>&1 | tee /dev/tty)
if (echo "$yarn_output" | grep -q 'error.*frozen-lockfile'); then # work around https://github.com/yarnpkg/yarn/issues/2538
exit 1
fi
@john-kurkowski Total nerd snipe...
Given that the frozen lockfile setting appears to specifically be for CI servers, this seems to be a pretty big shortcoming.
Sorry for that. When I implemented the feature, I assumed, incorrectly, that reporter.error would cause the process to exit with non-zero. But, that is apparently not so. The PR above should fix this.
This seems to be a regression in 0.23.2 - can anyone confirm?:
$ git co yarn.lock
$ yarn install --frozen-lockfile
yarn install v0.23.2
[1/4] ๐ Resolving packages...
warning Integrity check: Lock files don't match
[2/4] ๐ Fetching packages...
[3/4] ๐ Linking dependencies...
[4/4] ๐ Building fresh packages...
success Saved lockfile.
โจ Done in 6.76s.
$ echo $?
0
Update: seems to be a regression: https://gist.github.com/joscha/9079e5853bce79ee5de2d081188b10b8
Yes, looks like a regression