create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

Issues with running npx create-react-app on node 15.2.1

Open thebreaktop opened this issue 5 years ago • 24 comments

When I run npx create-react-app appname I get the following error message:

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.

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 /Users/hat/Projects/youtube/react
npm ERR! command failed
npm ERR! command sh -c create-react-app loll

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/hat/.npm/_logs/2020-11-23T06_53_20_858Z-debug.log

I then ran npm uninstall -g create-react-app and got the following output:

up to date in 380ms

found 0 vulnerabilities

After running npm uninstall -g create-react-app command I ran npx create-react-app appname and I got the same error message as above.

This is what the error log located in /Users/hat/.npm/_logs/2020-11-23T06_53_20_858Z-debug.log looks like:

0 verbose cli [
0 verbose cli   '/Users/hat/.nvm/versions/node/v15.2.1/bin/node',
0 verbose cli   '/Users/hat/.nvm/versions/node/v15.2.1/lib/node_modules/npm/bin/npm-cli.js',
0 verbose cli   'exec',
0 verbose cli   '--',
0 verbose cli   'create-react-app',
0 verbose cli   'loll'
0 verbose cli ]
1 info using [email protected]
2 info using [email protected]
3 timing config:load:defaults Completed in 2ms
4 timing config:load:file:/Users/hat/.nvm/versions/node/v15.2.1/lib/node_modules/npm/npmrc Completed in 1ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 1ms
7 timing config:load:env Completed in 1ms
8 timing config:load:file:/Users/hat/Projects/youtube/.npmrc Completed in 0ms
9 timing config:load:project Completed in 1ms
10 timing config:load:file:/Users/hat/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/Users/hat/.nvm/versions/node/v15.2.1/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 0ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 1ms
16 timing config:load:setUserAgent Completed in 0ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 8ms
19 verbose npm-session ccfcf510fa3376be
20 timing npm:load Completed in 17ms
21 http fetch GET 304 https://registry.npmjs.org/create-react-app 252ms (from cache)
22 timing arborist:ctor Completed in 1ms
23 timing arborist:ctor Completed in 0ms
24 timing arborist:ctor Completed in 0ms
25 timing command:exec Completed in 1728ms
26 verbose stack Error: command failed
26 verbose stack     at ChildProcess.<anonymous> (/Users/hat/.nvm/versions/node/v15.2.1/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
26 verbose stack     at ChildProcess.emit (node:events:329:20)
26 verbose stack     at maybeClose (node:internal/child_process:1055:16)
26 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:288:5)
27 verbose cwd /Users/hat/Projects/youtube
28 verbose Darwin 19.6.0
29 verbose argv "/Users/hat/.nvm/versions/node/v15.2.1/bin/node" "/Users/hat/.nvm/versions/node/v15.2.1/lib/node_modules/npm/bin/npm-cli.js" "exec" "--" "create-react-app" "loll"
30 verbose node v15.2.1
31 verbose npm  v7.0.8
32 error code 1
33 error path /Users/hat/Projects/youtube
34 error command failed
35 error command sh -c create-react-app loll
36 verbose exit 1

I ran npm cache clean --force to clear the cache. The output after running this command was npm WARN using --force Recommended protections disabled.

I'm running

  • node version: v15.2.1
  • npm version: 7.0.8
  • npx version: 7.0.8
  • OS: maOS CAtalina 10.15.7
  • Im using vvm version 0.35.3 to manage my node versions

I also noticed that when I downgraded my node version to v14.1.0, npm and npx was automatically downgraded to 6.14.6. I then ran npx create-react-app appname and the command worked. I was able to create react app.

thebreaktop avatar Nov 23 '20 07:11 thebreaktop

facing the same issue

vaibhavarora14 avatar Nov 23 '20 15:11 vaibhavarora14

okay wait got it fixed after removing it from with npm and yarn command

vaibhavarora14 avatar Nov 23 '20 15:11 vaibhavarora14

Same issue. I already run

- npm uninstall -g create-react-app
- yarn global remove create-react-app

On MacOs Big Sur. node -v : v14.15.1 npm -v : 7.0.12

EDIT: npm install -g create-react-app fix it but it's the opposite of what the message suggest to do...

GautierT avatar Nov 23 '20 15:11 GautierT

I reverted to the latest stable version of npm (from 7.0.10 to 6.14.9) and that resolved the issue for me. I'm on MacOs Catalina (10.15.7) with node version 15.2.1 installed.

NinaKWelch avatar Nov 23 '20 23:11 NinaKWelch

@NinaKWelch how did you revert to the latest version of npm? I am facing the same issue

SincerelyBrittany avatar Nov 23 '20 23:11 SincerelyBrittany

I ran npm install -g npm@latest

NinaKWelch avatar Nov 24 '20 00:11 NinaKWelch

@NinaKWelch

I ran npm install -g npm@latest

Thanks!

eduardomillans avatar Nov 24 '20 02:11 eduardomillans

I ran npm install -g npm@latest

It helps, thanks!

sergey-zavadsky avatar Nov 24 '20 09:11 sergey-zavadsky

I ran npm install -g npm@latest

THANK YOU!

handbremse avatar Nov 24 '20 10:11 handbremse

I had to install the LTS version of node (v14.15.1) to fix the problem. I was using the latest one (v15.2.1).

These are now the versions installed in my Linux Ubuntu 20.04.01 system: npm: 6.14.8 npx: 6.14.8 node: v14.15.1

Obs: I'm using NVM (Node Version Manager)

JoakimTeixeira avatar Nov 24 '20 11:11 JoakimTeixeira

I reverted to the latest stable version of npm (from 7.0.10 to 6.14.9) and that resolved the issue for me. I'm on MacOs Catalina (10.15.7) with node version 15.2.1 installed.

It helps. For downgrade npm used this command npm install -g [email protected] -force.

  • nvm: 1.1.7
  • node: 15.2.1
  • npm: 7.0.8

ningaro avatar Nov 24 '20 12:11 ningaro

I ran npm install -g npm@latest

thanks, this worked!

garynye avatar Nov 24 '20 17:11 garynye

I ran npm install -g npm@latest

Thanks, man!! This solved my Issue

swapnil0709 avatar Nov 26 '20 13:11 swapnil0709

I ran npm install -g npm@latest

out of all 1 million articles i have read your comment was my dream come true lol !! THANK YOU 🙏 !

harleydi avatar Nov 27 '20 22:11 harleydi

I ran npm install -g npm@latest

yeh that works for me thanks

umerwaseem4 avatar Nov 28 '20 13:11 umerwaseem4

NPM 7 had some changes with peer dependencies, which might be some of the problem here. There is also a dependency somewhere deep in the tree that doesn't support node 15. I think it's an older version of chokidar.

It's safest to use node 14 and NPM 6 until the newest versions get tested more.

nrayburn-tech avatar Nov 28 '20 15:11 nrayburn-tech

I ran npm install -g npm@latest

thanks

DanielGeek avatar Nov 30 '20 03:11 DanielGeek

As @GautierT said, running npm install -g create-react-app fixed the problem for me, despite the command notifying you to uninstall create-react-app globally.

NeonWizard avatar Dec 01 '20 07:12 NeonWizard

Had a similar issue with CRA.

Node version: 13.11.0 NPM version: 7.5.3

I downgraded to NPM 6.14.11 and i was able to create fine.

ScotttP avatar Feb 10 '21 03:02 ScotttP

npm install -g npm@latest it's really helpful, thanks!

Vitalij202020 avatar Feb 13 '21 14:02 Vitalij202020

I solved this using the following command.

npm uninstall -g create-react-app

npm cache clean --force

then

npx create-react-app project_name --template all

Thanks for this! Worked for me too.

chaurasiawadh avatar Mar 17 '21 06:03 chaurasiawadh

I ran npm install -g npm@latest

it worked , thanks a lot

prasannanimbalkar avatar Jul 17 '21 16:07 prasannanimbalkar

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

stale[bot] avatar Jan 09 '22 15:01 stale[bot]

This is still an issue with:

39 verbose node v16.15.0
40 verbose npm  v8.5.5

and npm install -g npm@latest does not helps.

lcsiki avatar Aug 22 '22 12:08 lcsiki