ladjs / superagent

Ajax for Node.js and browsers (JS HTTP client). Maintained for @forwardemail, @ladjs, @spamscanner, @breejs, @cabinjs, and @lassjs.
https://ladjs.github.io/superagent/
MIT License
16.58k stars 1.33k forks source link

Engine syntax incorrect #1660

Closed ungrim97 closed 2 years ago

ungrim97 commented 2 years ago

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: superagent@7.0.0
npm ERR! notsup Not compatible with your version of node/npm: superagent@7.0.0
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 commented 2 years ago

#1661

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

niftylettuce commented 2 years ago

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

nbezzala commented 2 years ago

This is still an issue.

$ npm install superagent npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: 'superagent@7.0.1', 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 commented 2 years ago

What might be a valid fix? Not too experienced with engines property.

On Friday, January 7, 2022, Nitish Bezzala @.***> wrote:

This is still an issue.

$ npm install superagent npm WARN EBADENGINE Unsupported engine { npm WARN EBADENGINE package: @.***', 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

— Reply to this email directly, view it on GitHub https://github.com/visionmedia/superagent/issues/1660#issuecomment-1007855030, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAD7XBID3LYVFLGK4BUGK2LUU6GHTANCNFSM5LOQKERA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you modified the open/close state.Message ID: @.***>

ungrim97 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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/.

jcurlier commented 2 years ago

+1

niftylettuce commented 2 years ago

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 https://github.com/mysticatea/eslint-plugin-node/issues/315.