-
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
docs: The url to the yarn corepack documentation is not found (invalid url) when corepack is enabled for the repo, but not the action. #9182
Comments
If you run the following cd $(mktemp -d)
corepack enable yarn
corepack use yarn
corepack disable yarn
npm install yarn@1.22.22 -g
yarn cache dir in a local Ubuntu terminal window you will see the error message with the URL highlighted in blue. or as text: error This project's package.json defines "packageManager": "yarn@4.7.0". However the current global version of Yarn is 1.22.22. Presence of the "packageManager" field indicates that the project is meant to be used with Corepack, a tool included by default with all official Node.js distributions starting from 16.9 and 14.19. You can right-click on it, select OpenLink and the website is opened in a browser window. You can also click on the above text when it is interpreted by Markdown and it will open correctly. Your problem occurs if you copy the text from a CI log file and you copy also the full stop (period) at the end of the sentence together with the URL. The sentence could be made less susceptible to this issue if it were rearranged as "Check out https://yarnpkg.com/corepack for more information." In that case there would be spaces either side of the URL to make it easier to copy. I can't however see where this text is coming from although it is in the final build of Yarn 1.22.22 and this version is frozen, so I wouldn't expect the maintainers to change the text. |
You've probably solved this by now, but in case anybody else is reading this: In order to fix the workflow you will need to add: - run: corepack enable yarn before you call actions/setup-node@v4 with Yarn caching enabled. Unfortunately |
Hi @MikeMcC399 yes, the actually error I had is solved. - name: Setup target Node.js to enable Corepack
uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }}
- run: corepack enable
- uses: actions/setup-node@v4
with:
node-version: ${{ env.node_version }} But the issue I open was just that the url mentioned in the error is invalid. |
I looked at the URL in the error message in #9182 (comment) and I made a suggestion to improve it. It's possible that the maintainers may be reading this and that they might make a change, however officially Yarn v1 Classic has been frozen for quite some time. |
Thanks @MikeMcC399. Thanks for taking the time to go thought the issue and providing helpful feedback ❤ |
Originally I filed this bug under setup node: actions/setup-node#1206 (comment)
But it was pointed out that the message was a yarn specific error message.
In summary:
The project was migrated to yarn berry (in my case yarn@4.6.0)
I have a Github action setup that tries to build the project when core pack is not yet enabled.
The following error is presented when the Github action tries to run the setup node.
I noticed that the link provided in the error is not found, because it includes a full stop.
The link should be
https://yarnpkg.com/corepack
and nothttps://yarnpkg.com/corepack.
To reproduce
Repro steps:
I used the migration docs here to upgrade from yarn 1 to the new version.
But I think it can be re-produced with the following:
corepack enable
yarn set version berry
The action I use as an example:
The text was updated successfully, but these errors were encountered: