Skip to content

Comments

Require NPM 18#375

Merged
mvidner merged 4 commits intomasterfrom
require-node18
Dec 19, 2022
Merged

Require NPM 18#375
mvidner merged 4 commits intomasterfrom
require-node18

Conversation

@mvidner
Copy link
Contributor

@mvidner mvidner commented Dec 16, 2022

Problem

We spent some hours debugging a problem where the web frontend was not updated because the machine had NPM 17 which is no longer enough

Solution

Tell zypper, and npm, to install v 18 at least

Testing

  • Tested manually: ran ./setup.sh with
-  "engines": { "node": ">=18" },
+  "engines": { "node": ">=1899" },
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: undefined,
npm WARN EBADENGINE   required: { node: '>=1899' },
npm WARN EBADENGINE   current: { node: 'v19.1.0', npm: '8.19.3' }
npm WARN EBADENGINE }

@mvidner
Copy link
Contributor Author

mvidner commented Dec 16, 2022

@dgdavid says "it was a consequence of #331 I believe"

OK, anyway I hope package.json has a way to say "complain loud and clear unless npm >= 18"

@coveralls
Copy link

coveralls commented Dec 16, 2022

Coverage Status

Coverage remained the same at 76.106% when pulling 9450ff3 on require-node18 into 09d561d on master.

@mvidner
Copy link
Contributor Author

mvidner commented Dec 16, 2022

Ha!!
https://docs.npmjs.com/cli/v6/configuring-npm/package-json#engines

You can specify the version of node that your stuff works on:

{ "engines" : { "node" : ">=0.10.3 <0.12" } }

And, like with dependencies, if you don't specify the version (or if you specify "*" as the version), then any version of node will do.


sudo zypper --non-interactive install gcc gcc-c++ make openssl-devel ruby-devel \
npm git augeas-devel cockpit jemalloc-devel || exit 1
'npm>=18' git augeas-devel cockpit jemalloc-devel || exit 1
Copy link
Contributor Author

@mvidner mvidner Dec 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$ rpm -q --provides npm19
...
nodejs-npm = 19.1.0
npm = 19.1.0   # match here
npm(npm) = 8.19.3
npm19 = 19.1.0-1.1
npm19(x86-64) = 19.1.0-1.1

@mvidner mvidner merged commit 653d850 into master Dec 19, 2022
@mvidner mvidner deleted the require-node18 branch December 19, 2022 11:53
@imobachgs imobachgs mentioned this pull request Feb 13, 2023
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 this pull request may close these issues.

3 participants