keystone icon indicating copy to clipboard operation
keystone copied to clipboard

Node 20 (LTS) support

Open Josef-Reichardt opened this issue 1 year ago • 2 comments

Project setup fails on node 20 (current LTS - with yarn and npm) because of a dependency which is not compatible to node 20:

@keystone-6/core > @prisma/migrate > mssql > tedious > @azure/identity > @azure/[email protected]

error @azure/[email protected]: The engine "node" is incompatible with this module. Expected version "10 || 12 || 14 || 16 || 18". Got "20.4.0"

I've created the app via yarn create keystone-app and the setup proceeds with npm automatically because it fails with yarn:

grafik

But after that, when I remove package-lock.json and node_module because I want to work with yarn instead of npm and run yarn install it reports the following error:

grafik

npm install only displays a warning for that:

grafik

Tested on node v20.4.0 and v20.11.0.

Josef-Reichardt avatar Jan 13 '24 14:01 Josef-Reichardt

Probably an option for you is to resolve that dependency - if you aren't using it - to nothing. That said, officially, we are constrained by Prisma's support for now.

dcousens avatar Jan 14 '24 03:01 dcousens

Yes, this works. Thanks for the workaround but it's not a very good first use experience. The reason is that @keystone-6/core uses @prisma/migrate version 4.16.2 (the latest version is 5.8.1 at the moment).

Are there plans to update this dependency?


I have solved it by the mentioned workaround for now in my package.json:

{
  ...
  "dependencies": {
    "@keystone-6/auth": "^7.0.0",
    "@keystone-6/core": "^5.0.0",
    "@keystone-6/fields-document": "^7.0.0",
    "typescript": "^4.9.5"
  },
  "resolutionsComments": {
    "@prisma/migrate": "Required until https://github.com/keystonejs/keystone/issues/8987 is resolved!"
  },
  "resolutions": {
    "@prisma/migrate": "5.8.1"
  }
}

This displays a warning but it seems to work.

warning Resolution field "@prisma/[email protected]" is incompatible with requested version "@prisma/[email protected]"

Josef-Reichardt avatar Jan 18 '24 15:01 Josef-Reichardt

Any updates on this?

fkrauthan avatar Feb 27 '24 00:02 fkrauthan

A workaround we did is to stub that package completely with an empty package as we use postgresql only

packages/mssql/package.json (create this file with content below, adjust version)

{
	"name": "mssql",
	"version": "9.1.1"
}

Then install it explicitly

npm install mssql@file:packages/mssql

unrevised6419 avatar Mar 07 '24 11:03 unrevised6419

Problem is still there and yes it is strange first time experience

Forux avatar Mar 18 '24 08:03 Forux

Got it to work like this instead @Josef-Reichardt or maybe this only fixed the issue in my case since i am using yarn workspaces

{
  "name": "keystone-app",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "keystone dev",
    "start": "keystone start",
    "build": "keystone build",
    "postinstall": "keystone build --no-ui --frozen"
  },
  "dependencies": {
    "@keystone-6/auth": "^7.0.0",
    "@keystone-6/core": "^5.0.0",
    "@keystone-6/fields-document": "^7.0.0",
    "typescript": "^4.9.5"
  },
  "resolutions": {
    "**/@azure/msal-node": "2.7.0"
  }
}

Jeanclaudeaoun avatar Apr 30 '24 06:04 Jeanclaudeaoun

@Jeanclaudeaoun we have updated prisma in the newest major of @keystone-6/core: ^6.0.0 - can you update to that instead?

dcousens avatar Apr 30 '24 07:04 dcousens