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

Engine syntax incorrect #1660

Closed
ungrim97 opened this issue Jan 7, 2022 · 9 comments
Closed

Engine syntax incorrect #1660

ungrim97 opened this issue Jan 7, 2022 · 9 comments

Comments

@ungrim97
Copy link
Contributor

ungrim97 commented Jan 7, 2022

I cannot install the latest v7 on node 16 at the moment. NPM is complaining about incompatible version:

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":">=6.4.0 <13|>=14"}
npm ERR! notsup Actual:   {"npm":"8.3.0","node":"v16.13.0"}

I believe the issue is the syntax used in the engines block in the package.json

I think instead of:

  "engines": {
    "node": ">=6.4.0 <13|>=14"
  },

it should be:

  "engines": {
    "node": ">=6.4.0 <13||>=14"
  },
``` (double pipe instead of single)
ungrim97 added a commit to ungrim97/superagent that referenced this issue Jan 7, 2022
@ungrim97
Copy link
Contributor Author

ungrim97 commented Jan 7, 2022

#1661

(Side note: I am unreasonablly annoyed that the PR for issue 1660 is numbered 1661...)

@niftylettuce
Copy link
Collaborator

@nbezzala
Copy link

nbezzala commented Jan 8, 2022

This is still an issue.

$ npm install superagent
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE package: '[email protected]',
npm WARN EBADENGINE required: { node: '>=6.4.0 !13' },
npm WARN EBADENGINE current: { node: 'v17.3.0', npm: '8.3.0' }
npm WARN EBADENGINE }

up to date, audited 38 packages in 2s

9 packages are looking for funding
run npm fund for details

found 0 vulnerabilities

@niftylettuce
Copy link
Collaborator

niftylettuce commented Jan 8, 2022 via email

@ungrim97
Copy link
Contributor Author

ungrim97 commented Jan 8, 2022

Looking at the Semver spec I don't think there actually is a not equals operator available.

It looks like the correct solution is the one I original gave or the symantically equivelent PR by @nbezzala above. Both of which might cause you Eslint issues.

@ungrim97
Copy link
Contributor Author

ungrim97 commented Jan 8, 2022

Also running Eslint seems to suggest that the earliest supported node that will work is v10.10.0 (Catch binding and http2 support).

Removing the catch binding would lower the supported Nodejs to v8.13.0 as http2 was backported

@textbook
Copy link

textbook commented Jan 11, 2022

To express "v6.4.0 or newer, excluding v13" you want e.g. >=6.4.0 <13 || >=14; you can try these out on https://semver.npmjs.com/.

glasser added a commit to glasser/superagent that referenced this issue Jan 11, 2022
`!` is not supported by the semver library. This fixes a regression in v7
when used with engine-strict mode.

While the change in this PR may look similar to the state before ladjs#1660, 
it differs by using two pipe characters instead of one.
@jcurlier
Copy link

+1

niftylettuce pushed a commit that referenced this issue Jan 11, 2022
`!` is not supported by the semver library. This fixes a regression in v7
when used with engine-strict mode.

While the change in this PR may look similar to the state before #1660, 
it differs by using two pipe characters instead of one.
@niftylettuce
Copy link
Collaborator

v7.0.2 released https://github.com/visionmedia/superagent/releases/tag/v7.0.2

I had to publish with np --no-tests because of yarn test lint errors with eslint not parsing engines properly per mysticatea/eslint-plugin-node#315.

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

No branches or pull requests

5 participants