keystone
keystone copied to clipboard
Node 20 (LTS) support
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:
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:
npm install only displays a warning for that:
Tested on node v20.4.0 and v20.11.0.
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.
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]"
Any updates on this?
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
Problem is still there and yes it is strange first time experience
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 we have updated prisma in the newest major of @keystone-6/core: ^6.0.0 - can you update to that instead?