chromaui/chromatic-cli

The engine "node" is incompatible with this module. Expected version "18.16.1". Got "20.8.1"

Closed this issue · 14 comments

Bug report

Previously our action was working fine. As of this morning I'm getting the following error.

Error

The CLI tried to run your build-storybook script, but the command failed. This indicates a problem with your Storybook. Here's what to do:
    → Command failed: yarn run build-storybook --output-dir /tmp/chromatic--1759-SARwqzIUwEU0 --webpack-stats-json /tmp/chromatic--1759-SARwqzIUwEU0
- Check the Storybook build log printed below.
- Run npm run build-storybook or yarn build-storybook yourself and make sure it outputs a valid Storybook by opening the generated index.html in your browser.
- Review the build-storybook CLI options at https://storybook.js.org/docs/configurations/cli-options/#for-build-storybook
Command failed with exit code 1: yarn run build-storybook --output-dir /tmp/chromatic--17[59]-SARwqzIUwEU0 --webpack-stats-json /tmp/chromatic--1759-SARwqzIUwEU0
error: The engine "node" is incompatible with this module. Expected version "18.16.1". Got "20.8.1"
error Commands cannot run with an incompatible environment.
ℹ Build command:
yarn run build-storybook --output-dir /tmp/chromatic--1759-SARwqzIUwEU0 --webpack-stats-json /tmp/chromatic--1759-SARwqzIUwEU0
ℹ Runtime metadata:
{
  "nodePlatform": "linux",
  "nodeVersion": "20.8.1",
  "packageManager": "yarn",
  "packageManagerVersion": "1.22.22"
}
ℹ Storybook build output:

GitHub Action

  visual-tests:
    needs: [interaction-tests, changed-files]
    if: ${{ needs.changed-files.outputs.any_changed == 'true' }}
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: actions/setup-node@v4
        with:
          node-version: 18.16.1
      - run: yarn
      - uses: chromaui/action@v1
        with:
          node-version: 18.16.1
          projectToken: ${{ secrets.CHROMATIC_PROJECT_TOKEN }}
          token: ${{ secrets.GITHUB_TOKEN }}
          onlyChanged: true
          exitZeroOnChanges: true

We're seeing the same.

Pinning chromaui/action to the prev version seems to have resolved the issue for now.

uses: chromaui/action@v11.4.0

Thanks @jordan-paz!

Hello @CWSites @jordan-paz,

Can you try updating to v11.5.1 (chromaui/action@v11.5.1)?

Same error on 11.5.1 however 11.4.0 works.

Hey!

Having the same issue as above but

Expected version ">= 20.11.0". Got "20.8.1"

Reverting "chromaui/action@v1 to "chromaui/action@v11.4.0 solved it for us

@CWSites @jordan-paz changing the engines.node version in your package.json from 20.10 to 20.8 may resolve it.
Can you try? Let me know if this works!

Hi everyone,

We are looking into this and hope to have a resolution soon.

We may have a fix for this.
We've tested it and are going to merge soon.
#1003 (review)

With latest version I still get another error which is yarn related:

`error This project's package.json defines "packageManager": "yarn@4.2.2". 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.
Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.`

In our github environment yarn 1.22.22 is enabled by default but in this particular pipeline we use 4.2.2 version and do use corepack... it used to work before, don't get what's wrong!

With latest version I still get another error which is yarn related:

`error This project's package.json defines "packageManager": "yarn@4.2.2". 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. Corepack must currently be enabled by running corepack enable in your terminal. For more information, check out https://yarnpkg.com/corepack.`

In our github environment yarn 1.22.22 is enabled by default but in this particular pipeline we use 4.2.2 version and do use corepack... it used to work before, don't get what's wrong!

I managed to fix my issue adding SKIP_YARN_COREPACK_CHECK: 0 env option top the chromatic task in our CI and the problem looks finally gone!

@CWSites were you able to resolve the issue? Let us know!

🚀 Issue was released in v11.5.4 🚀

Thanks for reporting! This should be fixed in v11.5.4. Please let us know if you continue to experience the issue after upgrading.

Sorry I've been swamped, I'll give it a shot!