Create-react-app not working


I am following the Full-stack engineer path and am currently learning React. I am now at the instructions for installing React:

I’ve read these carefully, however, when typing:

npx create-react-app myfirstreactapp

At first I get the following error:

Error: EPERM: operation not permitted, mkdir 'C:\Users\Stijn'
program not found in create-react-app

It seems that I have worked around this by changing the system authorizations (although I am in doubt whether I should actually do that), but then the next error appears:

npm ERR! code ENOLOCAL
npm ERR! Could not install from "Klijn\AppData\Roaming\npm-cache\_npx\1984" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Stijn Klijn\AppData\Roaming\npm-cache\_logs\2021-05-01T13_36_08_074Z-debug.log

I’m not sure why this is and what I am supposed to do. The Codecademy info makes it seem a lot simpler to get started with React :slight_smile: Can anyone help me out? Thanks a lot in advance!

Hi there, you can try this, which works for me:

  1. Delete your npm and npm-cache from your Roaming directory or any where it is present.
  2. Then go to your vs code or terminal and be on the folder which you are creating the project like (my app). Enter this command npm install npm@latest -g
  3. and now run npx create-react-app ./ OR npx create-react-app my-app

Here is a list of solutions you can try.

That seems to have worked. Thanks!

You’re welcome, feel free to mark this issue as solved.

Unfortunately it keeps complaining. This time when i try npm start I get the following error:

> [email protected] start
> react-scripts start

'JavaScript\testreact\testreact\node_modules\.bin\' is not recognized as an internal or external command,
operable program or batch file.
  throw err;

Error: Cannot find module 'C:\Users\Stijn Klijn\Desktop\react-scripts\bin\react-scripts.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
    at Function.Module._load (internal/modules/cjs/loader.js:725:27)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)
    at internal/main/run_main_module.js:17:47 {
  requireStack: []

I don’t understand what to do here. Why is it referring to a folder as a command? And why is it suddenly looking for a file in a completely different folder? Argh :frowning:

Have you tried this?

The Do’s and Don’ts

Do format your code before posting.

  • Do make sure you post your question in the right category.
  • Do make sure you put the instructions, error and link to the exercise you are stuck on in your post.
  • Do make sure you put the exercise number in the post title.
  • Do ask for help if you need it!

✘ Don’t ask for help on an exercise without posting code.

  • Don’t post your question more than once - a moderator will move it if needed, so you don’t need to repost.
  • Don’t start debates
  • Don’t advertise. Not for services, nor other groups or communities.
  • Don’t post external links non-code related
  • Don’t post full working code without explanation.
  • Don’t give out personal details.
  • Don’t use bad language - Keep it PG here, please.
  • Don’t ‘revive’ topics that are old.

Please don’t repost the your problem multiple times. (Cannot launch React project - #2 by usernamegiapreso)

Yes! This fixed it. Thx again!