Amanda Signorelli
Amanda Signorelli

Reputation: 41

I can't use "create-react-app" ("This is related to npm not being able to find a file.")

I tried every single thing I've found, but I just can't run create-react-app. I tried to uninstall node and install again, use yarn, clean cache, create with "npm init ..." but nothing works.

Microsoft Windows [versão 10.0.19043.1889]
(c) Microsoft Corporation. Todos os direitos reservados.

C:\Program Files (x86)\Windows Resource Kits\Tools>cd C:\Users\user\meu_app

C:\Users\user\meu_app>node -v
v16.17.0

C:\Users\user\meu_app>npm -v
8.18.0

C:\Users\user\meu_app>npx create-react-app myapp
npm ERR! code ENOENT
npm ERR! syscall spawn C:\Users\user
npm ERR! path C:\Users\user\meu_app
npm ERR! errno -4058
npm ERR! enoent spawn C:\Users\user ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user\AppData\Local\npm-cache\_logs\2022-09-02T19_06_17_314Z-debug-0.log

Upvotes: 4

Views: 8632

Answers (3)

Hamza
Hamza

Reputation: 51

Run This Commands:

npm uninstall -g create-react-app

or

 yarn global remove create-react-app

After This Create Your App Again and It will Work Properly :)

Upvotes: 5

Seven
Seven

Reputation: 602

I ran into the same error when I set up my new machine. You have to install create-react-app on your machine via npm.

npm i -g create-react-app

The error is about not finding the create-react-app.

Upvotes: 11

Props
Props

Reputation: 11

I have never seen this issue before. npx is distributed with npm 5.2+, so that shouldn't be the issue. It seems your issue is similar to this one Can't install any NPM package, error 4058

Try these steps:

  • Delete package-lock.json and run NPM again (probably can skip this one if it does not pertain to your issue)
  • Ensure no other processes of node.js are running (check task manager)
  • If you are using visual studio code, close it and try running npm install again.
  • If all else fails, restart your computer.

See thread here: https://github.com/npm/npm/issues/17444

Let me know if that helps; otherwise, I will keep looking.

Upvotes: 1

Related Questions