1

Please help. I've tried all what people have done already. I ran the commands below step by step as follows...

node -v 
v17.3.0
npm -v
8.3.1
npx -v
8.3.1
yarn -v
1.22.17
npm uninstall -g create-react-app
yarn remove global create-react-app
npm cache clean -f
npm i -g npm@latest
npx clear-npx-cache
npx [email protected]

Been dealing with this bug for quite some time. Nobody has been able to solve it thus far.

Again, I cannot do npx create-react-app. It creates package.json file but not the template. I get the "need to uninstall global create-react-app" error. Windows 10 machine. Using bash inside VsCode.

I feel that up a directory or two, there is some hidden create-react-app file. But I've been the admin and ran these commands from the root directory C:/users/admin.

Does not work using yarn either.

It worked once I uninstalled nodejs and re-installed it again but then it starts error again later.

3 Answers 3

4

Try doing this - install the latest react app modules locally in the working directory by using:

npm install create-react-app@latest

and then:

npx create-react-app my-app
Sign up to request clarification or add additional context in comments.

Comments

0

Runnning create-react-app with potential errors npx create-react-app myapp You are running create-react-app 4.0.0, which is behind the latest release (4.0.1). We no longer support global installation of Create React App. The current solution is simple — run create-react-app and target the latest version.

Run creact-react-app using the latest version npx create-react-app@latest myapp Different versions of npm may help as well, and you can upgrade using the following command. Please note that this may affect other projects on your system.

Upgrading npm npm install -g npm@latest ( just wanted to post this for anybody who is having issues with npx create-react-app myapp.) I found this solved my problem

Comments

0

I was able to fix this issue by deleting all files in npm folder, which are located in the C/Users/"YourUser"/Appdata/Roaming/npm, and the npm-cache folder, which is located in C/Users/"YourUser"/Appdata/Roaming.

Then try to run the npx create-react-app react-app command in the C:/ folder. Do not create the project in the users folder.

Note: if you delete the files in the npm folder it will also remove all of the global packages installed on your pc.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.