-
Notifications
You must be signed in to change notification settings - Fork 76
Yarn Berry (yarn 2) support #22
Description
Context
Yarn 2 (Berry) was released recently and does not seem to be compatible with this action. --frozen-lockfile has been deprecated in favour of --immutable, and the format of the yarn.lock has changed.
There seems to be a handy new version property at the top of the yarn.lock file for yarn@2 for detecting the version:
__metadata:
version: 4Here's the output from GitHub Actions:
CI Output
Run bahmutov/npm-install@v1.1.0
running npm-install GitHub Action
trying to restore cached NPM modules
restoring cache /home/runner/.cache/yarn
primary key yarn-linux-x64-409b01bf62cebe1069e54d446bcc46c2361735696e33fc069e2aff8495f1982c9c81a1a642c27c8d650596a484c6d58b4ac99baf221baed836ebdb5b15ea88a4
Cache not found for input keys: yarn-linux-x64-409b01bf62cebe1069e54d446bcc46c2361735696e33fc069e2aff8495f1982c9c81a1a642c27c8d650596a484c6d58b4ac99baf221baed836ebdb5b15ea88a4, yarn-linux-x64-.
npm cache hit false
installing NPM dependencies using Yarn
yarn at "/usr/bin/yarn"
/usr/bin/yarn --frozen-lockfile
yarn install v1.21.1
[1/5] Validating package.json...
[2/5] Resolving packages...
warning @commitlint/cli > babel-polyfill > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning @commitlint/cli > babel-polyfill > babel-runtime > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Error: The process '/usr/bin/yarn' failed with exit code 1
at ExecState._setResult (/home/runner/work/_actions/bahmutov/npm-install/v1.1.0/dist/index.js:896:25)
at ExecState.CheckComplete (/home/runner/work/_actions/bahmutov/npm-install/v1.1.0/dist/index.js:879:18)
at ChildProcess.<anonymous> (/home/runner/work/_actions/bahmutov/npm-install/v1.1.0/dist/index.js:779:27)
at ChildProcess.emit (events.js:210:5)
at maybeClose (internal/child_process.js:1021:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
Motivation
Yarn 2 (Berry) was released last month. It created a complex rift in the npm community. Many hate it, many love it, most are "staying out of the way" and don't want much to do with it.
I've never used yarn, but as of the 2x release, I'm liking it. It makes mono repositories a lot easier to deal with. I wrote something about it here. I'd love for this action to detect and support yarn@2. It doesn't seem to be going away, and it's a fairly simple implementation. I'm going to have to revert to manually installing dependencies for the moment.