Description
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...
> core-js@2.6.11 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
> core-js@3.6.4 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...
> core-js@2.6.11 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
> core-js@3.6.4 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>