-
Notifications
You must be signed in to change notification settings - Fork 21
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
Set Node/npm Engines #2001
Set Node/npm Engines #2001
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this, I tested with Node 14 and the npm compilation was ok, using Node 12 gave me the expected error below:
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for [email protected]: wanted: {"node":"^14","npm":"^6"} (current: {"node":"12.22.1","npm":"6.14.12"})
npm ERR! notsup Not compatible with your version of node/npm: [email protected]
npm ERR! notsup Not compatible with your version of node/npm: [email protected]
npm ERR! notsup Required: {"node":"^14","npm":"^6"}
npm ERR! notsup Actual: {"npm":"6.14.12","node":"12.22.1"}
However when using Node 16 and 18, the error was not Unsupported engine
, but this:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/prettier
npm ERR! dev prettier@"npm:[email protected]" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer prettier@">=2" from @wordpress/[email protected]
npm ERR! node_modules/@wordpress/prettier-config
npm ERR! dev @wordpress/prettier-config@"^1.1.2" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /Users/ianlin/.npm/_logs/2023-06-28T08_32_10_165Z-eresolve-report.txt
It's weird that the error is not Unsupported engine
even though we added ^14
in package.json. What do you think about this behaviour?
When I used Nonde 16 I got the right message.
However, if I delete package-lock.json yes I got the mentioned error. My understanding is that NPM tries first to resolve the dependency tree, and after, it checks the engines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the clarification, I tried not deleting package-lock.json and it showed the expected error message.
Changes proposed in this Pull Request:
.npmrc
package.json
Detailed test instructions:
nvm use 14
and see the npm compilation buildsnvm use 18
(or any other version, not 14) and see the npm compilation failsAdditional details:
Changelog entry