7

New Node & React user here. I'm following the React tutorial but run into a problem on my Windows 10 machine:

C:\Users\Wout>create-react-app my-app

Creating a new React app in C:\Users\Wout\my-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...

npm ERR! path C:\Users\Wout\my-app\node_modules\abab
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Wout\my-app\node_modules\abab' -> 'C:\Users\Wout\my-app\node_modules\.abab.DELETE'
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\Wout\AppData\Roaming\npm-cache\_logs\2018-03-14T15_21_11_867Z-debug.log

Aborting installation.
  npm install --save --save-exact --loglevel error react react-dom react-scripts has failed.

Deleting generated file... node_modules
Deleting generated file... package.json
Deleting my-app / from C:\Users\Wout
Done.

Things I've tried so far:

  • Reinstall Node.js (v8.10.0, npm 5.6.0)
  • Disabling Adobe creative cloud sync & related processes (these were spawning node.exe processes)
  • Running CMD in admin
  • Run the command from VS Code Powershell
  • Closing Visual Studio Code before executing the command
  • Run the command with npx
  • Rebooted the system several times
  • Running the command from the user folder as well as other drives
  • Running the Typescript version: create-react-app my-app --scripts-version=react-scripts-ts

It's all quite strange to me, since on Mac OS X the command executes without issues. I also can't seem to find other people with the same problem.

For what it's worth, it always stops after this "finalizing abab" package step.

I have an installation of XAMPP running an Apache and MySQL service, don't know if that has anything to do with it. I don't think so since I'm not even running the app yet, plus the server runs on port 3000 anyway.

1
  • ENOENT indicate a missing file. Is C:\Users\Wout\my-app\node_modules\abab there? try installing this single package before running create-react-app my-app. This should be achieved with command npm install abab Commented Mar 14, 2018 at 15:45

9 Answers 9

31

Instead of create-react-app my-app, run it like npx create-react-app my-app. If error still exists, run 'npm install -g npm'. Then, run npx create-react-app my-app again.

Sign up to request clarification or add additional context in comments.

Comments

13

Just started React coding and was getting the same error.

  1. Installed VS code
  2. Installed Node.js
  3. Run npx create-react-app MyApp and throws errors
  4. Went to Windows(C:)/Users/UserName/AppData/Roaming
  5. Create new folder and name it npm
  6. Back to vs Code, the command should run (it actually asked to install extra packages)

In step 4, if you cannot see AppData, your File explorer needs to be set : View/Show/Hidden Items

Comments

6

I eventually solved it by closing as many extra processes as possible. Will try to find out which process was interfering with the command.

Edit: Ding ding ding! It was MalwareBytes! The "realtime protection 30-day trial" had restarted after an update and it was screwing with the filesystem.

Comments

0

I also just installed MalWareBytes, and I get the same error. I tried running create-react-app from the CLI as administrator, and while it was running I read your solution, and so I shut down MalWareBytes as the installation was in progress.

It worked, but I don't know if that is because I ran as administrator, or because I shut down MalWareBytes.

But for anyone having this problem, you could also try running your command prompt/powershell with administrator rights.

Comments

0

try running the command from the project directory... worked for me. i ran the command from the parent of the project directory for example: reactApp/hellowworld run from helloworle directory instead...

Comments

0

In case you have just install the create-react-app command , try to run the command from a new terminal . (re-open another tab).

Comments

0

Try running > 'npm fund' then try to rerun > 'npm create-react-app my-app'

This worked for me.

1 Comment

Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
0

I had this problem while downloading node js 21.5.0

i got below error

PS P:\react js> npx create-react-app contactapp npm ERR! code ENOENT npm ERR! syscall lstat npm ERR! path C:\Users\bharath\AppData\Roaming\npm npm ERR! errno -4058 npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\bharath\AppData\Roaming\npm' 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: C:\Users\bharath\AppData\Local\npm-cache\_logs\2024-01-02T06_59_12_414Z-debug-0.log

I resolved this error

by installing node js version 17.0.1 from archive

and followed this as below

npx create-react-app react-app

cd react-app

npm start

Comments

0
  1. Reinstall npm Using npm
npm uninstall -g npm
npm cache clean --force
npm install -g npm
  1. Clear npm Cache

npm cache clean --force

  1. Reinstall create-react-app
npm uninstall -g create-react-app
npm install -g create-react-app

now try npx create-react-app my-app

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.