1

Even though everything used to work couple of weeks ago, now I can not successfully create new react app with its templates.

When I try to run npx create-react-app my-app command, it only creates the folder with package.json, pckage-lock.json and node_modules. The public folder is missing and also, when I try to run npm start, it gives me an error saying:

npm ERR! missing script: start
npm ERR! A complete log of this run can be found in:

before it used to say happy hacking and the template page with react logo was displayed.

I tried to uninstall and install node again, clear cache but nothing helped. Any advice? Thank you so much!

My npm -v is 6.13.4 and node -v is v12.14.0

8

4 Answers 4

0

If you have installed create-react-app globally. remove that globally from you system

Try these steps

  1. npm uninstall -g create-react-app

  2. npx create-react-app app_name cd app_name npm start

Note- npx comes with npm 5.2+ and higher, see instructions for older npm versions

Check this reactjs documentation.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. I uninstalled it and ran npx create-react-app but it gave me this error: + [email protected] + [email protected] + [email protected] added 1674 packages from 765 contributors and audited 906205 packages in 93.644s 32 packages are looking for funding run npm fund for details found 0 vulnerabilities A template was not provided. This is likely because you're using an outdated version of create-react-app. Please note that global installs of create-react-app are no longer supported.
0

Faced the same issue and fixed it by following the below steps:

  1. Try to uninstall all existing global installation of create-react-app and check that they are removed properly by using the two commands below:

    • command for uninstalling: npm uninstall -g create-react-app

    • command for checking: which create-react-app

    • command for manual delete: rm -rf <path where create react app is located>

  2. Once all the versions are removed, use: npx create-react-app <name_of_the_app>

For more details refer here

Comments

0

First, update the npm and node using following commands:

npm install -g npm
npm cache clean -f
npm install -g n
n stable

Remove globally installed create-react-app using:

npm uninstall -g create-react-app

Use npx for using create-react-app directly:

npx create-react-app <project-name>

2 Comments

BTW you should not install create-react-app globally. This page says that they recommend uninstalling to ensure npx is always using the latest version
Updated my answer. The main point that I want to emphasize here is that node and npm should updated.
0

I was having the same issue, and saw a lot of the same answers saying to uninstall create-react-app globally and reinstall using npx create-react-app my-app.

Downgrading my version of Node to 8.11.1 is what fixed it.

sudo npm install -g n
sudo n 8.11.1
node -v
> v8.11.1

After that I ran npx create-react-app my-app and it worked as expected.

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.