Just started out with React using an online course from Udemy. For some reason my create-react-app
stopped working all of a sudden and it shows this log.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Users\Vahram\Desktop\Udemy-React\Personal-Notes\Sec5\pokedex-exercise\node_modules\postcss-normalize
npm ERR! dest C:\Users\Vahram\Desktop\Udemy-React\Personal-Notes\Sec5\pokedex-exercise\node_modules\.postcss-normalize.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Vahram\Desktop\Udemy-React\Personal-Notes\Sec5\pokedex-exercise\node_modules\postcss-normalize' -> 'C:\Users\Vahram\Desktop\Udemy-React\Personal-Notes\Sec5\pokedex-exercise\node_modules\.postcss-normalize.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\Vahram\AppData\Roaming\npm-cache\_logs\2021-05-06T21_38_53_463Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Deleting pokedex-exercise/ from C:\Users\Vahram\Desktop\Udemy-React\Personal-Notes\Sec5
Done.
Just started out with React using an online course from Udemy. For some reason my create-react-app
stopped working all of a sudden and it shows this log.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
npm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Users\Vahram\Desktop\Udemy-React\Personal-Notes\Sec5\pokedex-exercise\node_modules\postcss-normalize
npm ERR! dest C:\Users\Vahram\Desktop\Udemy-React\Personal-Notes\Sec5\pokedex-exercise\node_modules\.postcss-normalize.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Vahram\Desktop\Udemy-React\Personal-Notes\Sec5\pokedex-exercise\node_modules\postcss-normalize' -> 'C:\Users\Vahram\Desktop\Udemy-React\Personal-Notes\Sec5\pokedex-exercise\node_modules\.postcss-normalize.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\Vahram\AppData\Roaming\npm-cache\_logs\2021-05-06T21_38_53_463Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-scripts cra-template has failed.
Deleting generated file... node_modules
Deleting generated file... package.json
Deleting pokedex-exercise/ from C:\Users\Vahram\Desktop\Udemy-React\Personal-Notes\Sec5
Done.
I checked out similar questions on here and there were some solutions I tried. The usual answer is to delete package.json
but I don't have that seeing as I'm trying to make a new React app. Here's what I've tried so far:
- Originally tried
npx create-react-app my_app
- Then tried running
npm install -g create-react-app
and thencreate-react-app my_app
. - Then tried
npm cache clean --force
followed bynpm rebuild
then step 2 again. - Then tried
npm init --yes
to generate apackage.json
file, followed by trying to make a new app again using CRA. - Tried restarting the machine
Curious thing I noticed that I'm not sure is related to the issue: When I go to Task Manager, there are two Node.js processes running. When I try to end one, it spawns another Node.js process... I can't get rid of all Node.js processes. This is why I originally restarted the machine.
Any help is appreciated! I have no idea how to proceed... I'm even thinking of formatting my machine and starting everything from scratch. However, I'd like to know why this happens so that I can avoid it in the future.
Share Improve this question edited May 7, 2021 at 5:12 Vahram Poghosyan asked May 6, 2021 at 21:48 Vahram PoghosyanVahram Poghosyan 531 silver badge5 bronze badges 10 | Show 5 more comments4 Answers
Reset to default 16I just solved this using the following command.
npm uninstall -g create-react-app
and then:
npm install -g create-react-app
Regards
While I may be a bit late to the conversation, I'd like to offer some guidance that could prove helpful, especially for newcomers. I've encountered a particular issue with the new create-react-app, and here's a solution to address it:
Step 1: Start by uninstalling the global create-react-app package using the command npm uninstall -g create-react-app
.
Step 2: Next, reinstall the create-react-app globally by executing npm install -g create-react-app
.
Step 3: Don't forget to close the Terminal window.
Step 4: Finally, initiate the creation of your new React application with the command npx create-react-app my-app
.
These steps should assist you in resolving the issue you're facing.
You can try reinstalling npx using npm i -g npx
only npm uninstall -g create-react-app and then, installer anyway version.
ENOENT: no such file or directory, rename
is telling you that either therename
command is not anything that your OS knows about (but it comes with Windows so that should work) or the path given torename
doesn't exist, so: is this on a genuinely create attempt? – Mike 'Pomax' Kamermans Commented May 7, 2021 at 5:01cd
ing into the directoryC:\Users\Vahram\Desktop\Udemy-React\Personal-Notes\Sec5
and running eithernpx create-react-app pokedex-exercise
orcreate-react-app pokedex-exercise
. – Vahram Poghosyan Commented May 7, 2021 at 5:06cd
ed into it, and tried a whole new name for an app I haven't tried before. It worked... So thank for that answer! But what's going on? There are no projects showing up in the file explorer in the folders I was trying to create it in before. – Vahram Poghosyan Commented May 7, 2021 at 6:18