I’ve been following a video course for full stack web development, and have gotten to the react part. The video course says that the create-react-app npm package can be used to readily and easily do an initial setup of a react app file hierarchy with all dependencies.
The method discussed in the course is to install the craete-react-app package globally using npm install -g create-react app
, which I did. Then I should be creating the react app by using create-react-app my-project-name
. When I launch this command, i get an output like this: Screenshot of error. In text:
Creating a new React app in E:UniversityLearning materialWeb
DevelopmentUdemy – The Complete Web Developer in 2021 Zero to Mastery
2021-419. React.js, React Hooks, Redux (Hooks and Redux videos moved
to end of course!)exercise 1robofriends.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 spawn
C:WINDOWSsystem32cmd.exe npm ERR! path E:UniversityLearning
materialWeb DevelopmentUdemy – The Complete Web Developer in 2021
Zero to Mastery 2021-419. React.js, React Hooks, Redux (Hooks and
Redux videos moved to end of course!)exercise
1robofriendsnode_modulesbabel-runtimenode_modulescore-js npm ERR!
errno -4058 npm ERR! enoent spawn C:WINDOWSsystem32cmd.exe ENOENT
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoentnpm ERR! A complete log of this run can be found in: npm ERR!
C:UsersAminAppDataLocalnpm-cache_logs2021-05-02T16_25_06_903Z-debug.logAborting installation. npm install –save –save-exact –loglevel
error react react-dom react-scripts cra-template has failed.Deleting generated file… package.json Deleting robofriends/ from
E:UniversityLearning materialWeb DevelopmentUdemy – The Complete
Web Developer in 2021 Zero to Mastery 2021-419. React.js, React
Hooks, Redux (Hooks and Redux videos moved to end of course!)exercise
1 Done.
The log file mentioned in the error has no extra information as far as I can see, only the same error message exactly replicated in a log file along with the preceding installation steps. Just to be sure, I’ve made 3 pastebins to contain the gigantic log file here: Part 1 Part 2 Part 3
Methods I’ve tried to resolve the issue (And a combination of some) :
- The good old restart your computer!
- Clearing the npm cache by using
npm cache clear -f
- Uninstalling create-react app, and reinstalling
- Uninstalling create-react-app and using
npx create-react-app robofriends
to first install the package and then create the app folder right after - Opening my command line in administrator mode
Any help or guidance on the issue will be greatly appreciated. Thank you.
Also, it might help to mention that I am using Windows 10 64bit.
Answer
It looks like there is a problem with your path (special characters etc.). If I recreate your exact path on my drive, I fail to create a react-app as well. However, if you change your directory to another one and try again it should work!