N
Nuxtβ€’9mo ago
alexcali

@nuxt/kit incompatible with node 20

I am trying to get my nuxt project running on Node 20 using Nuxt 3.11.2 but I get the following error when I run yarn install:
yarn install v1.22.22
info No lockfile found.
[1/5] πŸ” Validating package.json...
[2/5] πŸ” Resolving packages...
warning @nuxt/typescript-build > fork-ts-checker-webpack-plugin > [email protected]: this will be v4
warning cypress > @cypress/request > [email protected]: when using stringify with arrayFormat comma, `[]` is appended on single-item arrays. Upgrade to v6.11.0 or downgrade to v6.10.4 to fix.
warning @nuxt/types > @types/serve-static > @types/[email protected]: This is a stub types definition. mime provides its own type definitions, so you do not need this installed.
[3/5] 🚚 Fetching packages...
error @nuxt/[email protected]: The engine "node" is incompatible with this module. Expected version "^14.16.0 || ^16.10.0 || ^17.0.0 || ^18.0.0 || ^19.0.0". Got "20.12.2"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
yarn install v1.22.22
info No lockfile found.
[1/5] πŸ” Validating package.json...
[2/5] πŸ” Resolving packages...
warning @nuxt/typescript-build > fork-ts-checker-webpack-plugin > [email protected]: this will be v4
warning cypress > @cypress/request > [email protected]: when using stringify with arrayFormat comma, `[]` is appended on single-item arrays. Upgrade to v6.11.0 or downgrade to v6.10.4 to fix.
warning @nuxt/types > @types/serve-static > @types/[email protected]: This is a stub types definition. mime provides its own type definitions, so you do not need this installed.
[3/5] 🚚 Fetching packages...
error @nuxt/[email protected]: The engine "node" is incompatible with this module. Expected version "^14.16.0 || ^16.10.0 || ^17.0.0 || ^18.0.0 || ^19.0.0". Got "20.12.2"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Any tips to get around it?
8 Replies
alexcali
alexcaliOPβ€’9mo ago
I opened this issue with more context: https://github.com/nuxt/nuxt/issues/26841
GitHub
Compatibility issues between @nuxt/kit and Node.20 Β· Issue #26841 Β·...
Environment Operating System: Darwin Node Version: v20.12.2 Nuxt Version: ^3.11.2 CLI Version: 3.11.1 Nitro Version: - Package Manager: [email protected] Builder: - User Config: app, css, postcss, sourc...
manniL
manniLβ€’9mo ago
Answered πŸ‘ŒπŸ»
alexcali
alexcaliOPβ€’9mo ago
I have a follow up question, perhaps we can chat here and then maune I can update my comments there. I see what you're saying but I am not sure why it keeps pulling that older version. What can I do to force it to pull a newer version? I've tried things like deleting my yarn.lock and node modules, using npx nuxi upgrade --force, but with no luck. Perhaps it's even a third-party library now that I think about it... πŸ€”
manniL
manniLβ€’9mo ago
Check via npm why @nuxt/kit
alexcali
alexcaliOPβ€’9mo ago
I did, turns out nuxt-proxy relies on it in my case! At least now I know where to look, thanks!
manniL
manniLβ€’9mo ago
PS: you don’t need Nuxt proxy
manniL
manniLβ€’9mo ago
The BEST way to proxy your API in Nuxt https://youtu.be/J4E5uYz5AY8
Alexander Lichter
YouTube
The BEST way to proxy your API in Nuxt
➑️ Proxying routes to your back-end or third party APIs is a common practice! Over the last two years, various strategies came up in Nuxt. But not all of them work equally will. To figure out which two strategies are the recommended ones, we have a look at the four most common strategies, their shortcomings and which ones I would recommend to us...
alexcali
alexcaliOPβ€’9mo ago
Right, I tried migrating away from it but with no luck just yet. This is what I had:
modules: ["@pinia/nuxt", "nuxt-proxy"],
proxy: {
options: {
target: process.env.EXTERNAL_API_HOST,
changeOrigin: true,
pathFilter: ["/allmedia"],
},
},
modules: ["@pinia/nuxt", "nuxt-proxy"],
proxy: {
options: {
target: process.env.EXTERNAL_API_HOST,
changeOrigin: true,
pathFilter: ["/allmedia"],
},
},
This is what I currently have:
routeRules: {
"/allmedia/**": {
proxy: "https://external..host.com",
},
},
routeRules: {
"/allmedia/**": {
proxy: "https://external..host.com",
},
},
Not sure what's different, but I do get success codes in both cases - I just don't get back any json data anymore with the new method. Still investigating it on my end
Want results from more Discord servers?
Add your server