npx create-react-app fails because of core-js update.
Describe the bug
When I run npx create-react-app client, it terminates while trying to update core-js, and
core-js does not update properly.
Did you try recovering your dependencies?
C:\mitesh\javascriptcode\calendar>npm --version 6.14.2
Which terms did you search for in User Guide?
I did not find anything similar to my output.
Environment
C:\mitesh\javascriptcode\calendar\client>npx create-react-app --info
Environment Info:
current version of create-react-app: 3.4.0
running from C:\Users\kumarm4\AppData\Roaming\npm\node_modules\create-react-app
System:
OS: Windows 10 10.0.18363
CPU: (12) x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz
Binaries:
Node: 12.16.1 - C:\Program Files\nodejs\node.EXE
Yarn: Not Found
npm: 6.14.2 - C:\Users\kumarm4\AppData\Roaming\npm\npm.CMD
Browsers:
Edge: 44.18362.449.0
Internet Explorer: 11.0.18362.1
npmPackages:
react: 16.13.0
react-dom: 16.13.0
react-scripts: Not Found
npmGlobalPackages:
create-react-app: Not Found
Steps to reproduce
- Go to working directory. Run npm install create-react-app -g
- Run npx create-react-app client
- cd client
- npm version core-js
Expected behavior
create-react-app client will finish and tell you to cd into client directory.
npm version core-js will display version of core-js
Actual behavior
npx create-react-app client gives me the following output:
C:\mitesh\javascriptcode\calendar>npx create-react-app client
Creating a new React app in C:\mitesh\javascriptcode\calendar\client.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
> [email protected] postinstall C:\mitesh\javascriptcode\calendar\client\node_modules\babel-runtime\node_modules\core-js > node -e "try{require('./postinstall')}catch(e){}"
Microsoft Windows [Version 10.0.18363.720]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\mitesh\javascriptcode\calendar\client\node_modules\babel-runtime\node_modules\core-js>
It places me in core-js folder.
Then npm install -g core-js gives me the following output:
C:\mitesh\javascriptcode\calendar\client>npm view core-js version
3.6.4
C:\mitesh\javascriptcode\calendar\client>npm install core-js -g
> [email protected] postinstall C:\Users\kumarm4\AppData\Roaming\npm\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
Microsoft Windows [Version 10.0.18363.720]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\kumarm4\AppData\Roaming\npm\node_modules\core-js>
Reproducible demo
To reproduce, do npm create-react-app client.
Then corrupt your core-js dependency in %appdata%/npm/node_modules/core-js.
(Note. I didn't corrupt my dependency myself.)
npx create-react-app client gives me the following output:
C:\mitesh\javascriptcode\calendar>npx create-react-app client
Creating a new React app in C:\mitesh\javascriptcode\calendar\client.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
> [email protected] postinstall C:\mitesh\javascriptcode\calendar\client\node_modules\babel-runtime\node_modules\core-js > node -e "try{require('./postinstall')}catch(e){}"
Microsoft Windows [Version 10.0.18363.720]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\mitesh\javascriptcode\calendar\client\node_modules\babel-runtime\node_modules\core-js>
It places me in core-js folder.
Then npm install -g core-js gives me the following output:
C:\mitesh\javascriptcode\calendar\client>npm view core-js version
3.6.4
C:\mitesh\javascriptcode\calendar\client>npm install core-js -g
> [email protected] postinstall C:\Users\kumarm4\AppData\Roaming\npm\node_modules\core-js
> node -e "try{require('./postinstall')}catch(e){}"
Microsoft Windows [Version 10.0.18363.720]
(c) 2019 Microsoft Corporation. All rights reserved.
C:\Users\kumarm4\AppData\Roaming\npm\node_modules\core-js>
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.
Abosnd02
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.
This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.
Though I am using Linux, I am facing exactly same problem. npx create-react-app, it seems always goes far deprecated core-js.
First I thought it was a issue due to package installer (like yarn, npm etc.) But after using many package installers I came to the conclusion that this issue is completely related to 'create-react-app'.
So far I've not been able to find any reasonable solution for it and it is highly likely that this is internal bug.