redwoodjs / redwood

The App Framework for Startups
https://redwoodjs.com
MIT License
17.28k stars 991 forks source link

[Bug?]: yarn create redwood-app incompatible with node v16 #7225

Open archae0pteryx opened 1 year ago

archae0pteryx commented 1 year ago

What's not working?

When creating a brand new app on node v16, the script errors and will not create an app.

How do we reproduce the bug?

To recreate:

  1. make sure you're using node v16 - nvm use v16 or the like
  2. run yarn create redwood-app my-app
  3. see this error
error create-strapi-app@3.6.5: The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.x.x". Got "16.19.0"

What's your environment? (If it applies)

I cant access rw info cause my redwood won't install.

Maybe you can add this to the template here in case someone cant either? at least on unix-like paper weights.

uname -s -m # system info
node -v # versions
yarn -v
echo $0 # my shell
# look in package json for redwood core version

- Darwin x86_64
- v16.19.0
- 3.3.0
- zsh
- @redwoodjs/core = 3.7.1

# Browsers really aren't applicable here but i am using:
Firefox Dev Edition: 103.0.2

Are you interested in working on this?

simoncrypta commented 1 year ago

It's maybe related with #7021 . Like the last issue, I tried to replicate with the latest node 16 and everything works. I see on your error message that it came from create-strapi-app@3.6.5 and seem to be unrelated with Redwood, however is not the first time I saw something from Strapi that create trouble. I will investigate.

simoncrypta commented 1 year ago

Yup, my memory is good

I'm getting the following error.

`error create-strapi-app@3.3.2: The engine "node" is incompatible with this module. Expected version ">=10.16.0 <=14.x.x". Got "16.17.0"`

thanks,

Originally posted by @chathuraa in https://github.com/redwoodjs/redwood/issues/6338#issuecomment-1240512931

But no more detail about this bug.

simoncrypta commented 1 year ago

My gut feeling is this bug came from yarn global cache.

Try to remove create-strapi-app: yarn global remove create-strapi-app and redo the redwood create app : yarn create redwood-app my-app

When you will create a new Strapi project, it should be re-added to global without issue.

Let me know if that works @archae0pteryx !

Tobbe commented 1 year ago

Just ran into this bug too, but for different versions of strapi and node

Error: Command failed with exit code 1: yarn create redwood-app ../rw-test-1337 --ts --git
error create-strapi-starter@4.0.7: The engine "node" is incompatible with this module. Expected version ">=12.22.0 <=16.x.x". Got "18.9.0"
error Found incompatible module.
yarn create v1.22.18
[1/4] Resolving packages...
[2/4] Fetching packages...

They've changed name of their setup script (as is evident if you actually pay attention and read the error message 🙄 ). Trying to remove the old one from cache fails

$ yarn global remove create-strapi-app
yarn global v1.22.18
[1/2] 🗑  Removing module create-strapi-app...
error This module isn't specified in a package.json file.
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.

But the new one was found and could be removed

yarn global remove create-strapi-starter                                                                                                                             ─╯
yarn global v1.22.18
[1/2] 🗑  Removing module create-strapi-starter...
[2/2] 🔨  Regenerating lockfile and installing missing dependencies...
warning "create-redwood-app > @redwoodjs/internal > @graphql-codegen/typescript-react-apollo@3.3.7" has unmet peer dependency "graphql-tag@^2.0.0".
warning "create-redwood-app > @redwoodjs/internal > babel-plugin-graphql-tag@3.3.0" has unmet peer dependency "graphql-tag@^2.10.1".
warning "create-redwood-app > @redwoodjs/internal > ts-node@10.9.1" has unmet peer dependency "@types/node@*".
warning "create-redwood-app > @redwoodjs/internal > @graphql-codegen/cli > cosmiconfig-typescript-loader@4.3.0" has unmet peer dependency "@types/node@*".
warning "create-redwood-app > @redwoodjs/internal > @graphql-codegen/cli > graphql-config@4.4.0" has unmet peer dependency "cosmiconfig-toml-loader@^1.0.0".
warning "create-redwood-app > @redwoodjs/telemetry > @whatwg-node/fetch > @whatwg-node/node-fetch@0.0.6" has unmet peer dependency "@types/node@^18.0.6".
warning "create-redwood-app > @redwoodjs/internal > @graphql-codegen/cli > @whatwg-node/fetch > @whatwg-node/node-fetch@0.0.1" has unmet peer dependency "@types/node@^18.0.6".
warning "create-redwood-app > @redwoodjs/internal > @graphql-codegen/typescript > @graphql-codegen/visitor-plugin-common > graphql-tag@2.12.5" has incorrect peer dependency "graphql@^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0".
warning "create-remix > @remix-run/dev > @remix-run/server-runtime@1.4.1" has unmet peer dependency "react@>=16.8".
warning "create-remix > @remix-run/dev > @remix-run/server-runtime@1.4.1" has unmet peer dependency "react-dom@>=16.8".
warning "create-remix > @remix-run/dev > jscodeshift@0.13.1" has unmet peer dependency "@babel/preset-env@^7.1.6".
warning "create-remix > @remix-run/dev > @remix-run/server-runtime > react-router-dom@6.3.0" has unmet peer dependency "react@>=16.8".
warning "create-remix > @remix-run/dev > @remix-run/server-runtime > react-router-dom@6.3.0" has unmet peer dependency "react-dom@>=16.8".
warning "create-remix > @remix-run/dev > @remix-run/server-runtime > react-router-dom > react-router@6.3.0" has unmet peer dependency "react@>=16.8".
success Uninstalled packages.
✨  Done in 18.52s.

And after clearing the cache I could install RW

faizalheesyam commented 1 year ago

I encountered similar issue, it triggered the create-strapi-app incompatibility with node 18.. got me thinking how does strapi related to redwoodjs..

my problem were simply solve with yarn global remove create-strapi-app