Thursday 17 June 2021

React - Error with create-react-app in Windows Environments - "Error: EEXIST: file already exists, mkdir 'C:\Users\XXXXX" - Fix/Solution

I've been asked this a more than once - so thought it prudent to document the current recommended workaround for this issue. While it is possible to install react apps globally to work around the error, it is not recommended per 

"If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app or yarn global remove create-react-app to ensure that npx always uses the latest version."


  • The windows user name has spaces in it (e.g. c:\User\David Klein)

Steps to reproduce error/issue:

  1. User attempts to create react app with npx in a Windows environment:
    npx create-react-app my-app
  2. Error is generated:
  1. Seems that the npm cache path will consequently have a space in the path and npm (or more likely create-react-app) can't handle this.

Solution (until bug is fixed):
  1. Get the current cache path with "npm config get cache"
  2. cd to the c:\Users\ directory and run dir /x to get the short name of that folder (e.g. DAVIDK~1
  3. Once you have the short path, set the npm cache to use that path with the following:
    npm config set cache c:\users\davidk~1\AppData\Roaming\npm-cache --global
You should now be free to continue with your react app goodness in Windows:


Salvador said...

A variety of profiles dating sites for married of beautiful girls, and an accurate selection of those who are ideal for you. Forget about loneliness - chat, flirt, fall in love, build relationships, get married and be happy!

zoeyriley890 said...

I need Matlab Homework Help services but can't see the prices. So how do I go about it? It's a Matlab emergency order with 20 questions, and it's due in the next 2 days. The Matlab Assignment Help task is not so complicated, because I'm a first-year student and it's my end-semester exam. Please let me know how to go about the order placement process.

Lokeswari said...

Excellent blog and I really glad to visit your post. Keep continuing...

web designing course in chennai | online internships for civil engineering students | online internship for mechanical engineering | online internship for mba students | online internship for computer science students | online internship for biotech students | internships for ece students | internship for electrical engineering student | internship for ece students

Tamil Typing said...

Thanks for sharing informative post. Are looking for best Tamil typing tool online, make use of our Tamil typing software to make translation faster. Thirumana Porutham in Tamil | Samacheer Kalvi Books PDF

Phuwadon said...

pgslot pgslot เว็บเดียวในประเทศไทยที่มีเกมสล็อตให้เล่นได้แบบเต็มพิกัดและมีโปรโมชั่นสุดพิเศษมากมายพร้อมโบนัสอีก 20 % ที่สามารถขอรับได้ตลอดเวลาและทุกยอดการฝากเงินเข้ามา พร้อมยังมีรางวัลอีกมากมายรอให้ลุ้นอยู่ในเกมอย่ารอช้ารีบๆเข้ามาเล่นแล้วไปคว้ารางวัลอีกมากมายได้เลย

mical disuza said...

Assignment help services are becoming increasingly popular among students looking for assistance with their academic tasks. With the help of these services, students can get expert guidance and support in completing their assignments on time and with accuracy. Marketing assignment help is one such service that provides assistance to students who are struggling with their marketing assignments. It offers personalised guidance and support on topics such as interpersonal communication, marketing strategy, market research, etc. With the help of this service, students can get the right kind of advice and assistance in completing their assignments accurately and on time .Marketing assignment help usually works with students based on the following methods:1. One-on-one tutoring: Students can connect with individual tutors through chat, email, or phone to get personalised assistance. This method also includes online assignments which are done in a synchronous manner.2. Group appointment coaching services: Students who can't meet individually can also schedule an appointment for group coaching sessions that work like a workshop in which students receive one-on-one support and guidance from experts as well as other students who have similar business plans. These types of session are usually conducted via.

Cyfuture Cloud said...

thanks for sharing valuable info with us

cloud hosting india

Dev Umar said...

Thanks for sharing useful information.
React Training in Chennai
React Training in Bangalore
React Training in Hyderabad
React Training in Mumbai
React Training in Kochi
React Training in Kolkata

Hnd Assignment Help said...

Engineering Management Assignment

Get Master of Engineering Management Assignment Help at Latrobe University with Punjab Assignment Help at an affordable price and timely delivery. We have Experts on the team.

la trobe lms login

la trobe lms login

Import Globals said...

Import Globals is one of the best Global Import Export Data providers for 90+ countries. Visit our website for Vietnam imports, Philippines imports, mexico import, and Russia import data.
Vietnam Import Data

naresh said...

Hi, thank you for providing this information. This blog provides excellent information, and I've included additional Oracle CPQ BML information that may be of assistance to you.
Oracle CPQ BML Training