Closed user135711 closed 5 years ago
This is definitely a bug. We don't necessarily want to encourage running pre-release versions of node but we also shouldn't block people from testing Create React App with them.
Do you happen to know if there's an issue related to this problem in node-semver
?
@iansu I just meant the behavior of pre-releases is odd with inequalities in semantic versioning if that was used here.
I'm happy to work on this 😃
update:
I've tried coerce-ing process.version
in createReactApp.js
It seems that nightly build also break other stuffs in yarn.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.5.1
warning You are using Node "10.0.0-nightly201803278eca6b8d3d" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0"
info No lockfile found.
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
error react-dev-utils@5.0.0: The engine "node" is incompatible with this module. Expected version ">=6".
For this setup the yarn npm package must be not installed globally, cra uses npm as fallback then.
(EDIT: I wrote the following before I looked up what semver.coerce does to the string, :1st_place_medal: ;> it is furthermore removing the character 'v' from the start and counts the intermediate dots which is a more safe solution)
I have not tested this workaround but it should be possible to pass the version string check with re-formatting by using "split()" with hyphen-minus "-" and then returning only the first array entry. https://github.com/salincakli/create-react-app/commit/64279c14cd3eb107960ce8d82d659d1db0d65761#diff-f9867c1e09ced1328f2ccdac4afac4a5R555
This way the version strings in the usual format are not modified. Example: 'v8.4.0'.split('-')[0] = 'v8.4.0'
Hi @nuttt, are you willing to submit a PR?
@Timer Hi, sorry for late reply. I'm kinda busy right now 😢. Please don't wait for me.
I'm also having this bug when I'm trying to upgrade CRA to v2.
In my localhost I have:
webpack@2.4.1: The engine "node" is incompatible with this module. Expected version ">=8".
And in my CI:
error eslint@5.6.0: The engine "node" is incompatible with this module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0".
Do I have to run yarn --ignore-engines
in order to upgrade to v2?
pd: I was using v6.10.3
of node and I upgraded to v8.12.0
in my local and it didn't work.
@albert-olive I don't think you specified your Node version. So it's a bit difficult to say.
I was editing my question before your comment @gaearon :D
If it doesn't work with 8.x that sounds like a Yarn bug.
Ok, I'll try and I'll tell you. Thanks Dan.
Hi again @gaearon,
I added the engines in my package.json and now I have the same error but saying that my current project expects that node version.
"engines": {
"node": ">=10.0.0",
"npm": ">=6.0.0"
}
...
b2b@1.4.5: The engine "node" is incompatible with this module. Expected version ">=10.0.0".
Thanks again.
This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs.
I'm running above node version 6, but creating the site fails with error:
This is probably related to the funny way semver treats comparisons with prerelease versions, but I think the scaffolding should still be supported.