Skip to content

Add engine property in package.json #6185

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
aspeddro opened this issue Apr 20, 2023 · 1 comment · Fixed by #6186
Closed

Add engine property in package.json #6185

aspeddro opened this issue Apr 20, 2023 · 1 comment · Fixed by #6186
Assignees

Comments

@aspeddro
Copy link
Contributor

aspeddro commented Apr 20, 2023

Some breaking changes in the rescript binary node may not be captured. We can add the engines property with engine-strict to catch errors on CI.

The format -check command (#5760) introduced in v10.1.0 broke the requirements described in the documentation.

Node.js version >= 10

Issue: rescript-lang/rescript-lang.org#675

Example:

package.json:

{
  "engineStrict": true,
  "engines": {
    "node": ">=18"
  }
} 

Run on CI (node v16):

npm i rescript-*.tgz --engine-strict
npm ERR! code EBADENGINE
npm ERR! engine Unsupported engine
npm ERR! engine 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":">=18"}
npm ERR! notsup Actual:   {"npm":"8.19.3","node":"v16.19.1"}

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/pedro/.npm/_logs/2023-04-20T20_04_38_734Z-debug-0.log

@aspeddro aspeddro changed the title Add engine property to package.json Add engine property in package.json Apr 20, 2023
@cknitt
Copy link
Member

cknitt commented Apr 21, 2023

It seems support for engineStrict in package.json was removed in npm 3.0.0.

But adding engines is certainly a good idea!

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

Successfully merging a pull request may close this issue.

2 participants