Skip to content
This repository has been archived by the owner on Oct 16, 2024. It is now read-only.

Pin node to version v16.3 and eslint parser to ecma2021 #128

Merged
merged 1 commit into from
Dec 21, 2022
Merged

Conversation

saw-jan
Copy link
Member

@saw-jan saw-jan commented Dec 21, 2022

Middleware requires a node version 16 so I have pinned it down to version 16.3 (as it has 100% compatibility with ecma2021)
see https://node.green/#ES2021

With this, yarn, npm, pnpm will report the incompatible node version

yarn

yarn install v1.22.19
[1/5] Validating package.json...
error middleware@1.8.2: The engine "node" is incompatible with this module. Expected version ">=16.3.0". Got "14.18.1"
error Found incompatible module.

npm

npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for middleware@1.8.2: wanted: {"node":">=16.3.0"} (current: {"node":"14.18.1","npm":"6.14.15"})
npm ERR! notsup Not compatible with your version of node/npm: middleware@1.8.2
npm ERR! notsup Not compatible with your version of node/npm: middleware@1.8.2
npm ERR! notsup Required: {"node":">=16.3.0"}
npm ERR! notsup Actual:   {"npm":"6.14.15","node":"14.18.1"}

pnpm

ERR_PNPM_UNSUPPORTED_ENGINE  Unsupported environment (bad pnpm and/or Node.js version)
Your Node version is incompatible with "/mnt/workspace/owncloud/owncloud-test-middleware".
Expected version: >=16.3.0
Got: v14.18.1

This is happening because the package's manifest has an engines.node field specified.
To fix this issue, install the required Node version.

And yarn lint will report if any code not supported by ecma2021 is added

/mnt/workspace/owncloud/owncloud-test-middleware/src/test.js
  2:15  error  Parsing error: Unexpected token =
✖ 1 problem (1 error, 0 warnings)
error Command failed with exit code 1.

Related issue

#78

@saw-jan saw-jan merged commit 540709f into main Dec 21, 2022
@delete-merged-branch delete-merged-branch bot deleted the node-ecma branch December 21, 2022 10:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants