Skip to content

unable to use plugin with Node 22.4.0 #1114

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

Closed
2 tasks done
seanlail opened this issue Mar 4, 2025 · 1 comment · Fixed by #1115 or sveltejs/svelte-eslint-parser#681
Closed
2 tasks done

unable to use plugin with Node 22.4.0 #1114

seanlail opened this issue Mar 4, 2025 · 1 comment · Fixed by #1115 or sveltejs/svelte-eslint-parser#681

Comments

@seanlail
Copy link

seanlail commented Mar 4, 2025

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

9.20.1

What version of eslint-plugin-svelte are you using?

2.46.1

What did you do?

I tried to update to the latest version of eslint-plugin-svelte and I get an error:

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

This error happened while installing a direct dependency of /Users/xxx/xxx

Your Node version is incompatible with "[email protected]".

Expected version: ^18.20.4 || ^20.18.0 || >=22.10.0
Got: v22.4.0

This is happening because the package's manifest has an engines.node field specified.

Due to the change in this PR: #885

What did you expect to happen?

It should be installable on Node 22

What actually happened?

Unable to install

Link to GitHub Repo with Minimal Reproducible Example

N/A

Additional comments

No response

@baseballyama
Copy link
Member

baseballyama commented Mar 4, 2025

After researching again, it turns out that it actually works with Node 18 or later. I initially thought the >=22.10.0 requirement was due to require(esm), but after checking the actual ESLint code, I found that ESM loading is done using await import(esm).
https://github.com/eslint/eslint/blob/fbdeff08f3bf4edd7f686af91d9ac0ed6e295080/lib/config/config-loader.js#L197

Therefore, the Node version required by eslint-plugin-svelte can likely be aligned with ESLint itself.
https://github.com/eslint/eslint/blob/main/package.json#L219

cc) @ota-meshi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants