question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Nx should define supported Node.js versions

See original GitHub issue

Description

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:open
  • Created 2 years ago
  • Reactions:29
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

3reactions
marckassaycommented, Mar 1, 2022

In addition, I discovered in Turborepo docs newer versions of node, developers can specify packageManager key in package.json.

2reactions
marckassaycommented, Feb 17, 2022

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nx, NodeJS and TypeScript Compatibility Matrix
Nx, NodeJS and TypeScript Compatibility Matrix. Below is a reference table that matches versions the latest major versions of Nx to the version...
Read more >
What's new in Nx 15?. Nx v15 is finally here! Let's go… - Nx Blog
Meaning they have their own package.json with dependencies declared. To share and link packages locally within the monorepo, the "workspaces" feature from NPM/ ......
Read more >
Upgrade Guide - Next.js
Upgrade Guide. Upgrading from 12 to 13. To update to Next.js version 13, run the following command using your preferred package manager:
Read more >
Migration Guide | Cypress Documentation
Node.js 12 reached its end of life on April 30, 2022. See Node's release schedule. This Node.js version will no longer be supported...
Read more >
Pnpm and Nx monorepo. Part 3 | Javier Brea
Both of them are executed using multiple Node.js versions. But remember that we defined as a requirement that the tests should be executed...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found