Skip to content
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

ERR_PNPM_UNSUPPORTED_ENGINE error when installing dependencies in Jetpack #5688

Open
fluiddot opened this issue Apr 20, 2023 · 0 comments
Open
Labels
Tooling [Type] Bug Something isn't working

Comments

@fluiddot
Copy link
Contributor

fluiddot commented Apr 20, 2023

We spotted CI failures in #5682 (CI job) related to installing the dependencies of the Jetpack repository. This is mainly caused by the fact that we use two different node versions, node 14 for Gutenberg/Gutenberg Mobile and node 18 for Jetpack.

Error message:

ERR_PNPM_UNSUPPORTED_ENGINE  Unsupported environment (bad pnpm and/or Node.js version)

Your Node version is incompatible with "/glob-promise/6.0.2(glob@8.1.0)".

Expected version: >=16
Got: 14.21.3

The dependency installation is handled by the script install-jetpack.sh. It actually switches the node version to the required by Jetpack, but still, pnpm fails upon installation command.

After exploring the culprit, we found out the following facts:

  • The node version used is the expected one.
  • The npm version used is the expected one.
  • The pnpm version used is the expected one.
  • The node version referenced in the npm configuration is NOT the expected one.

Here is an example:

  • node --version: v18.13.0
  • npm --version: 8.19.3
  • pnpm --version: 7.27.0
  • npm config get node-version: 14.21.3

The problem is caused due to the fact that pnpm is checking the node version with the value provided by the npm config, hence it's not matching the expected value.

Several workarounds have been tried, but none seemed to work:

  • Using -p parameter to enforce node and npm versions when using npx.
  • Setting the node-version config parameter manually by running npm config set node-version="$(node -v)".
  • Using the Node.js manager provided by pnpm.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tooling [Type] Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant