help icon indicating copy to clipboard operation
help copied to clipboard

npx create-react-app my-app errors

Open jaiswarabhishek opened this issue 3 years ago • 2 comments

Details

I am getting the below errors while running the command npx create-react-app my-app in Git bash terminal

npm ERR! code ENOENT
npm ERR! syscall spawn C:\Program Files (x86)\Java\jre1.8.0_301
npm ERR! path C:\Users\Lenovo\OneDrive\Desktop\R
npm ERR! errno -4058
npm ERR! enoent spawn C:\Program Files (x86)\Java\jre1.8.0_301 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\Lenovo\AppData\Local\npm-cache\_logs\2022-06-26T09_43_32_861Z-debug-0.log

How to fix this error? please help

Node.js version

I am using 16.15.1. node version

Example code

npm ERR! code ENOENT
npm ERR! syscall spawn C:\Program Files (x86)\Java\jre1.8.0_301
npm ERR! path C:\Users\Lenovo\OneDrive\Desktop\R
npm ERR! errno -4058
npm ERR! enoent spawn C:\Program Files (x86)\Java\jre1.8.0_301 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\Lenovo\AppData\Local\npm-cache\_logs\2022-06-26T09_43_32_861Z-debug-0.log

Operating system

Windows 11

Scope

Error while executing command npx create-react-app my-app

Module and version

create-react-app

jaiswarabhishek avatar Jun 26 '22 10:06 jaiswarabhishek

npm ERR! syscall spawn C:\Program Files (x86)\Java\jre1.8.0_301

Seems like an npm installation or something else is trying to access an installed version of JRE (Java Runtime Environment) but none is installed, which can be downloaded and installed from here.

Although we can't really determine what is requiring an installation of JRE with the provided stacktrace.

VoltrexKeyva avatar Jun 26 '22 20:06 VoltrexKeyva

I installed but still getting the same error

jaiswarabhishek avatar Jun 27 '22 04:06 jaiswarabhishek

@AbhishekTesla , did you manage to solve it?