yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.37k stars 2.72k forks source link

Getting @yarnpkg/parsers@3.0.0-rc.49: The engine "node" is incompatible with this module #8975

Closed doregg closed 10 months ago

doregg commented 10 months ago

Describe the bug

Start getting an error:

error @yarnpkg/parsers@3.0.0-rc.49: The engine "node" is incompatible with this module. Expected version ">=18.12.0". Got "16.15.1"
error Found incompatible module.

when running yarn global add lerna@^5.5.0. I realized that you pushed 3.0.0-rc.49 2 hours ago. It worked before.

To reproduce

yarn global add lerna@^5.5.0

Environment

Github pipelines
Node 16.15.1
yarn 1.22.19
lira1705 commented 10 months ago

Same problem happened after trying to do a clean install (no node-modules and yarn.lock). Keeping the yarn.lock version outdated kept things working.

Node version 14.21 yarn 1.22.19

onemargaro commented 10 months ago

Same problem happened to me as well, i did a clean docker-image with node:16-alpine and only works with v7+ lerna

/ # yarn add global lerna@6.6.2
yarn add v1.22.19
info No lockfile found.
[1/4] Resolving packages...
warning lerna > libnpmaccess > npm-registry-fetch > make-fetch-happen > cacache > @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
[2/4] Fetching packages...
error @yarnpkg/parsers@3.0.0-rc.49: The engine "node" is incompatible with this module. Expected version ">=18.12.0". Got "16.20.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
/ # node -v
v16.20.0
bryaningl3 commented 10 months ago

Until this gets fixed, maybe add the following to your package.json file:

  "resolutions": {
    "@yarnpkg/parsers": "3.0.0-rc.48.1"
  }
yanweibing commented 10 months ago

Until this gets fixed, maybe add the following to your package.json file:

  "resolutions": {
    "@yarnpkg/parsers": "3.0.0-rc.48.1"
  }

niu bi

vinhnguyen0429 commented 10 months ago

"resolutions": { "@yarnpkg/parsers": "3.0.0-rc.48.1" }

After adding this, it's still breaking, it can't see the resolution i've put in my package.json file? Any help on how to force it?

error @yarnpkg/parsers@3.0.0-rc.49: The engine "node" is incompatible with this module. Expected version ">=18.12.0". Got "14.21.3" error Found incompatible module.

divyesh-puri commented 10 months ago

@doregg You able to figure this out?

doregg commented 10 months ago

@divyesh-puri, For now, our workaround is not to use yarn global add. We're waiting for the yarn team/contributors reference

merceyz commented 10 months ago

One of your dependencies depends on a version of @yarnpkg/parsers that doesn't support the version of Node.js you're using. You can either upgrade your version of Node.js, use resolutions to force Yarn to install a version that does support your Node.js version, or report the issue to the relevant dependency.

Closing as this isn't a Yarn issue.

zhfkt commented 10 months ago

"resolutions": { "@yarnpkg/parsers": "3.0.0-rc.48.1" }

After adding this, it's still breaking, it can't see the resolution i've put in my package.json file? Any help on how to force it?

error @yarnpkg/parsers@3.0.0-rc.49: The engine "node" is incompatible with this module. Expected version ">=18.12.0". Got "14.21.3" error Found incompatible module.

Just paste the following in the yarn global package.json. Mine is /usr/local/share/.config/yarn/global/package.json. Pls run yarn global dir to check yours.

{
  "resolutions": {
    "@yarnpkg/parsers": "3.0.0-rc.48.1"
  }
}
asotog commented 10 months ago

last months I have seen many packages providers/vendors are not using semantic versioning the right way, this is braking change

vinhnguyen0429 commented 10 months ago

Thanks @zhfkt, that did the trick!!! I was adding it into my local package.json rather than my global package.json

Thanks for your help

RockyCott commented 10 months ago

you can try running yarn install --ignore-engines

divyesh-puri commented 10 months ago

What worked for me is

  1. Adding resolutions to package.json
    {
    "resolutions": {
    "@yarnpkg/parsers": "3.0.0-rc.48.1"
    }
    }
  2. Instead of doing yarn global add json lerna@6.6.2 on dockerfile I changed it to yarn global add json lerna@6.6.2 @yarnpkg/parsers@3.0.0-rc.48.1 --ignore-engines

These changes worked for me

JMuhire commented 9 months ago

Upgrade node to node lts will fix the issue