Nx should define supported Node.js versions
See original GitHub issueDescription
Nx should clearly define which node.js versions are supported. The supported versions should also be specified in the package.json files of the @nrwl
packages. Only LTS and Current Releases of Node.js should be supported.
For the release and end of life dates see: https://github.com/nodejs/Release/blob/main/schedule.json
Motivation
It is not clear which Node versions Nx supports. I cannot find any section in the docs about the supported versions of node. With the End of Life of Node.js v10 in April many packages Nx depends on started to only support Node v12 and newer. Because Nx does not clearly specify which versions it supports Contributors cannot update packages to versions which only support Node 12 and newer and it is not clear which features of node they can use.
Suggested Implementation
the nx-release.js
script should add the engines
field to the created package.json
files. I would recommend adding the engines
field to the main package.json
of the repository and copy it to the created package.json
so that there only exists one version of the engines
. Furthermore the Nx documentation should clearly describe which versions of Node.js are supported.
The currently correct engines
field should look like:
"engines": {
"node": "^12.13.0 || ^14.15.0 || >=16.0.0"
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:29
- Comments:5 (1 by maintainers)
In addition, I discovered in Turborepo docs newer versions of node, developers can specify
packageManager
key in package.json.@Phillip9587 explained the need for this clearly. In addition, perhaps having an HTML chart similar to what Cordova documentation has here, would be helpful. Because not all the latest dependencies (node, Angular, React, TS, etc.) are supported by Nx.
As @Phillip9587 suggested having “engines” declared in package.json would be ideal. In the meantime, looking at the
@types/node
version here will at the very least indicate roughly what node version was used last when that value changed.