Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npx create-react-app fails because of core-js update. #782

Closed
miteshkumar77 opened this issue Mar 16, 2020 · 2 comments
Closed

npx create-react-app fails because of core-js update. #782

miteshkumar77 opened this issue Mar 16, 2020 · 2 comments

Comments

@miteshkumar77
Copy link

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

  1. Go to working directory. Run npm install create-react-app -g
  2. Run npx create-react-app client
  3. cd client
  4. 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>
@DanielRuf
Copy link
Contributor

See #781

@slowcheetah
Copy link
Contributor

Can't reproduce. My react app successfully created.

Try to full uninstall core-js & reinstall.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants