Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Dependency installation error in GitHub Actions

I'm uploading the changes in NestJS via GitHub Actions.

Until yesterday, all code works normal. But today's code is an error.

steps:
      - uses: actions/checkout@v2

      # Initialize Node.js
      - name: Install Node.js 18
        uses: actions/setup-node@v3
        with:
          node-version: 18

      - name: Install dependencies
        run: |
          yarn install       <------------------ error

Below is an error message.

error This project's package.json defines "packageManager": "[email protected]". However the current global version of Yarn is 1.***.21.

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.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.
Error: Process completed with exit code 1.

I searched for an error message, but I couldn't get accurate information.

How do I make modifications to work normally?

like image 439
Mamochi Avatar asked Jun 28 '26 19:06

Mamochi


2 Answers

I deleted the following code from my package.json.

And all code works normal.

"packageManager": "[email protected]" <--- remove

I don't know the exact reason.

It is necessary to confirm that checking in Github Actions's policy has changed.

Please let me know if there is a more certain way. thank you

like image 183
Mamochi Avatar answered Jul 01 '26 19:07

Mamochi


A little late but hopefully useful some. In order to avoid the message, you need to set the version of yarn for the project for example

yarn set version 3.8.7
like image 40
technified Avatar answered Jul 01 '26 20:07

technified



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!