Open mscheper opened 3 years ago
Instead of using "create-react-app hello-world --template typescript", try the following: "npx create-react-app hello-world --template typescript"
About the vulnerabilities issue, see the info available at https://github.com/facebook/create-react-app/issues/11174
@ericcAtGitHub: Thanks for your comment.
Prepending the command in the book with npx
didn't make any difference at all, unfortunately; I'm still seeing ERR_OSSL_EVP_UNSUPPORTED
. Any idea what that means?
re the issue you linked to: I tried moving react-scripts
to devDependencies
and running with the --production
switch, and this also didn't change anything. I kept reading the thread but honestly got lost. Is the upshot that we should just ignore the vulnerabilities? If so, I hope this will be mentioned in a future edition of the book, because they do look concerning for people new to this tool.
@mscheper Sorry that my haste solution doesn't help for the first issue. For the second issue, the info convinces me to ignore those vulnerabilities in the meantime (surely this is not from an expert's view).
@mscheper - not sure if you ever ended up with a resolution, but it seems the error regarding ERR_OSSL_EVP_UNSUPPORTED relates to some changes in Node 17 (pertaining to SSL usage). Assuming you're using nvm, I'll bet if you do e.g.:
$ nvm use 16
...and retry whatever you were doing previously that triggered the error, it won't appear this time around (consider the security implication of such a quick fix, though - i.e. it sounds like Node 17 is enforcing a tighter security requirement). See e.g. this SO post for some further reference.
Regarding the other security errors: as mentioned in this comment, see https://github.com/facebook/create-react-app/issues/11174.
@TheFalseFriend: I'm on another new project now, so I just gave it another go, and yes, npx create-react-app hello-world --template typescript
now works. There was a deprecation warning and '8 moderate severity vulnerabilities', but the web page shown on p.20 of the book appeared for me, unlike when I created this issue. π
@ericcAtGitHub: I suggest future editions of the book direct readers to install a particular version, known to be working. It would also be helpful to suggest where to go for help, if it doesn't.
And as I said in this comment, I got lost wading through the comments in issue 11174, but it seems to imply that these 'security issues' should just be ignored. Since this is counterintuitive, it is also worth mentioning in the book, I reckon. As a very experienced developer, I've learnt to take web security seriously, and I'm sure those warnings would be scary for anyone starting out as well.
Thanks, both of you, for your help.
It's been a while since I've worked with React, so I bought this book and am following Chapter 1 on my Linux machine. I'm running Mint 20, and used nvm 0.39.0 to install node v17.0.1.
I'm not sure I've really felt 'JavaScript fatigue', but starting new React projects has been a gauntlet in the past, so I was excited when I read about
create-react-app
. It hasn't worked out for me, though, and I haven't found any more info about this hello-world app. Can you tell me what's wrong, or where to go for help?58 vulnerabilities sounds pretty bad. Sure enough, when I did
cd hello-world
andnpm start
, after some stuff flashed in my terminal and my scroll buffer got cleared, π I got this:I tried websearching for this error, and looked for a repo for the
hello-world
app, but didn't find anything that looked helpful.Then I tried:
Even more vulnerabilities now, but at least there's one less 'critical' one, and running the app produces a friendlier error message:
Friendly, but not entirely helpful, unfortunately. π webpack isn't in hello-world/package.json, and I don't have it installed on my system.
I tried running
npm install
anyhow (step 4), and got this:Ah! I did install typescript on my system, because it listed as a requirement, earlier in the chapter. Maybe that was a mistake, so I removed it and tried again.
π€ So typescript is still a problem.
I removed the entire hello-world directory structure and started all over again, and got exactly the same results, so removing the system typescript hasn't made a difference.
I installed yarn (step 5), but didn't really know how to use it, and since webpack wasn't in hello-world/package.json, I didn't delve deeper.
There is, however, a
webpack
subdirectory underhello-world/node_modules
(step 6), which I can't explain, but it looks like a pretty normal package directory to me.As for step 7:
I don't know what this indicates, though.
I also tried creating a
hello-world/.env
file and puttingSKIP_PREFLIGHT_CHECK=true
in it. That just made theERR_OSSL_EVP_UNSUPPORTED
error come up again. I've also triednpm audit fix --force
a few more times, but that only increased the number of vulnerabilities.I'd love for this to work, because it sounds simpler than the way I've created React projects in the past, and hopefully easier for other devs to get set up on the same project. Any ideas?