Skip to content

Localhost Refused to Connect #10436

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

Open
xixi743 opened this issue Jan 26, 2021 · 1 comment
Open

Localhost Refused to Connect #10436

xixi743 opened this issue Jan 26, 2021 · 1 comment

Comments

@xixi743
Copy link

xixi743 commented Jan 26, 2021

Describe the bug

Localhost refuses to connect after creating a fresh react application and running npm start. I first used npx create-react-app appname.

Did you try recovering your dependencies?

Yes, no effect.

npm --version 6.14.11

Which terms did you search for in User Guide?

Followed instructions from https://create-react-app.dev/docs/getting-started/.
This didn't help https://stackoverflow.com/questions/39959900/npm-start-error-with-create-react-app
Searched "failed at start react app".

Environment

  current version of create-react-app: 4.0.1
  running from /Users/alexis/.nvm/versions/node/v14.15.4/lib/node_modules/create-react-app

  System:
    OS: macOS 11.1
    CPU: (8) arm64 Apple M1
  Binaries:
    Node: 14.15.4 - ~/.nvm/versions/node/v14.15.4/bin/node
    Yarn: Not Found
    npm: 6.14.11 - ~/.nvm/versions/node/v14.15.4/bin/npm
  Browsers:
    Chrome: 88.0.4324.96
    Edge: Not Found
    Firefox: Not Found
    Safari: 14.0.2
  npmPackages:
    react: ^17.0.1 => 17.0.1 
    react-dom: ^17.0.1 => 17.0.1 
    react-scripts: 4.0.1 => 4.0.1 
  npmGlobalPackages:
    create-react-app: 4.0.1

Steps to reproduce

(Write your steps here:)

  1. run npx create-react-app portfolio
  2. cd portfolio
  3. npm start

Expected behavior

I expected to see the starting template for a react application.

Actual behavior

Chrome opened to local host with could not connect to localhost.

Debug Log:

1 verbose cli [
1 verbose cli   '/Users/alexis/.nvm/versions/node/v14.15.4/bin/node',
1 verbose cli   '/Users/alexis/.nvm/versions/node/v14.15.4/bin/npm',
1 verbose cli   'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /Users/alexis/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/alexis/projects/portfolio/node_modules/.bin:/Users/alexis/.nvm/versions/node/v14.15.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/alexis/.nvm/versions/node/v14.15.4/bin:/opt/homebrew/bin:/Users/alexis/Library/Python/3.8/bin:/opt/homebrew/bin:/Users/alexis/Library/Python/3.8/bin
9 verbose lifecycle [email protected]~start: CWD: /Users/alexis/projects/portfolio
10 silly lifecycle [email protected]~start: Args: [ '-c', 'react-scripts start' ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `react-scripts start`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/Users/alexis/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (/Users/alexis/.nvm/versions/node/v14.15.4/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1048:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid [email protected]
15 verbose cwd /Users/alexis/projects/portfolio
16 verbose Darwin 20.2.0
17 verbose argv "/Users/alexis/.nvm/versions/node/v14.15.4/bin/node" "/Users/alexis/.nvm/versions/node/v14.15.4/bin/npm" "start"
18 verbose node v14.15.4
19 verbose npm  v6.14.11
20 error code ELIFECYCLE
21 error errno 1
22 error [email protected] start: `react-scripts start`
22 error Exit status 1
23 error Failed at the [email protected] start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

I'm using a new Macbook Air running macOS Big Sur version 11.1.

@mariedasig
Copy link

did you see "Happy Hacking" at the end of npx create-react-app portfolio?

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

No branches or pull requests

2 participants