question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"npx create-react-app my-app" stopped working in 4.0.3

See original GitHub issue

Describe the bug

/tmp
▶ npx create-react-app my-app

You are running `create-react-app` 4.0.1, which is behind the latest release (4.0.3).

We no longer support global installation of Create React App.

Please remove any global installs with one of the following commands:
- npm uninstall -g create-react-app
- yarn global remove create-react-app

The latest instructions for creating a new app can be found here:
https://create-react-app.dev/docs/getting-started/

npm ERR! code 1
npm ERR! path /private/tmp
npm ERR! command failed
npm ERR! command sh -c create-react-app my-app

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/peterbe/.npm/_logs/2021-02-23T16_06_05_071Z-debug.log

/tmp
▶ npx --version
7.5.6

If create-react-app is not meant to work with npx, then https://create-react-app.dev/docs/getting-started/ is wrong.

Did you try recovering your dependencies?

not applicable

Which terms did you search for in User Guide?

  • npx
  • getting started

Environment

OSX Big Sur npm 7.5.6 node v15.2.1

Steps to reproduce

cd /tmp/
npx create-react-app my-app

Expected behavior

That it should create a directory called my-app.

Actual behavior

See error above.

Reproducible demo

Not applicable.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:13
  • Comments:40 (2 by maintainers)

github_iconTop GitHub Comments

149reactions
BenJenkinsoncommented, Feb 24, 2021

I just encountered this problem as well.

As a possible workaround, this worked for me:

npx create-react-app@latest my-app
7reactions
BenJenkinsoncommented, Feb 24, 2021

This same kind of issue has been reported several times now:

  • #10518 “start fails right after create-react-app”
  • #10495 “Not working after update”
  • #10132 “npx create-react-app is not working”
  • #10127 “Issues with running npx create-react-app on node 15.2.1”
  • #10133 “npx create-react-app my-app is isn’t installing the packages and i try uninstalling npm using -g but still”
  • #9910 “error running npx create-react-app@next”

These were all ultimately resolved with either:

npx create-react-app@latest my-app

Or, in one case (https://github.com/facebook/create-react-app/issues/10495#issuecomment-772893155), the exact opposite of what the error message tells you to do:

npm install -g create-react-app

npx create-react-app my-app

I suspect this is because the warning against “global” installs is really just checking for “is the version being run the latest version” which would be OK immediately after installing it globally, but then wouldn’t be OK two weeks & two new versions later.

There are also a lot of solutions that suggest completely uninstalling and reinstalling node & npm, which I think is mostly a really dramatic way to ensure you have cleared npm’s (and presumably npx’s) cache of installed packages.

Read more comments on GitHub >

github_iconTop Results From Across the Web

reactjs - Error while creating new React app ("You are running ...
Try running npx clear-npx-cache to clear your npx cache and then running the npx create-react-app your-app command. Also have a look at this ......
Read more >
you are running create react app which is behind latest
To solve the React.js error "You are running create-react-app 4.0.3, which is behind the latest release (5.0.0)", run the npx clear-npx-cache command and ......
Read more >
NPX Create React APP Not Working - YouTube
To create a new React App, we use npx command with create - react - app and then project name. It should create...
Read more >
Create React App cannot create new applications: No longer ...
When you try to install CRA from npx as shown below: · To resolve this error, you need to clear the cache of...
Read more >
You are running `create-react-app` 4.0.3, which is ... - Medium
You are running `create-react-app` 4.0.3, which is behind the latest release (5.0.1). We no longer support the global installation of Create React App....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found