简体   繁体   English

npm start 什么都不做 / localhost:3000 连接被拒绝

[英]npm start does nothing / localhost:3000 connection refused

I have tried running a few different tutorials here and I'm getting the same result.我尝试在这里运行一些不同的教程,但得到了相同的结果。 npm start does nothing. npm start 什么都不做。 no errors, nothing.没有错误,什么都没有。 try opening localhost:3000 and the connection is refused.尝试打开 localhost:3000 并拒绝连接。

It works just fine if I change to a different user on the same computer.如果我在同一台计算机上更改为不同的用户,它就可以正常工作。 Any ideas how I can reset this without loosing all my other settings for every app and password.任何想法如何在不丢失每个应用程序和密码的所有其他设置的情况下重置它。

I tried this with a fresh install of React and the basic tic tac toe on the React website as well as a few others.我通过全新安装的 React 和 React 网站上的基本 tic tac toe 以及其他一些网站进行了尝试。

Im working in vscode but I also tried it direct from the terminal.我在 vscode 中工作,但我也直接从终端尝试过。 set default browser to chrome.将默认浏览器设置为 chrome。 tried following this tutorial https://reactjs.org/tutorial/tutorial.html .尝试按照本教程https://reactjs.org/tutorial/tutorial.html 进行操作 pretty simple stuff.很简单的东西。 just doesn't seem to work只是似乎不起作用

Node -v v14.10.1 npm -v 6.14.8节点 -v v14.10.1 npm -v 6.14.8

ran this code in the terminal:在终端中运行此代码:

npx create-react-app my-app
cd my-app
npm start

And this is the result:这是结果:

peterfaretra@Peters-MacBook-Pro React % npx create-react-app my-app
npx: installed 98 in 10.58s

Creating a new React app in /Users/peterfaretra/Sites/React/my-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

+ react-scripts@3.4.3
+ react-dom@16.13.1
+ cra-template@1.0.3
+ react@16.13.1
added 1605 packages from 755 contributors and audited 1605 packages in 173.919s

69 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities


Initialized a git repository.

Installing template dependencies using npm...
npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.

+ @testing-library/jest-dom@4.2.4
+ @testing-library/user-event@7.2.1
+ @testing-library/react@9.5.0
added 36 packages from 57 contributors and audited 1641 packages in 12.107s

69 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Removing template package using npm...

npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself.

removed 1 package and audited 1640 packages in 6.202s

69 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities


Created git commit.

Success! Created my-app at /Users/peterfaretra/Sites/React/my-app
Inside that directory, you can run several commands:

  npm start
    Starts the development server.

  npm run build
    Bundles the app into static files for production.

  npm test
    Starts the test runner.

  npm run eject
    Removes this tool and copies build dependencies, configuration files
    and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

  cd my-app
  npm start

Happy hacking!
peterfaretra@Peters-MacBook-Pro React % 
peterfaretra@Peters-MacBook-Pro React % cd my-app 
peterfaretra@Peters-MacBook-Pro my-app % npm start
peterfaretra@Peters-MacBook-Pro my-app % 

I can see from your console/terminal that the project has been created at我可以从您的控制台/终端看到该项目已在

/Users/peterfaretra/Sites/React/my-app

But when i see the below但是当我看到下面的

peterfaretra@Peters-MacBook-Pro React % 
peterfaretra@Peters-MacBook-Pro React % cd my-app 
peterfaretra@Peters-MacBook-Pro my-app % npm start
peterfaretra@Peters-MacBook-Pro my-app % 

I am not a mac user so i can't say confidently but I cannot see the /sites path anywhere in the above mentioned paths.我不是 mac 用户,所以我不能自信地说,但我在上述路径中的任何地方都看不到/sites路径。 basically if i had to run my project my directory would be /Users/peterfaretra/Sites/React/my-app and then基本上,如果我必须运行我的项目,我的目录将是/Users/peterfaretra/Sites/React/my-app然后

npm start.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 localhost:3000 在使用 npm start 时拒绝连接 - localhost:3000 refused to connect when using npm start (7) 连接localhost 3000端口失败:连接被拒绝 - (7) Failed to connect to localhost port 3000: Connection refused http://localhost:3000/api/users net::ERR_CONNECTION_REFUSED - http://localhost:3000/api/users net::ERR_CONNECTION_REFUSED Node.JS:为什么我与 localhost:3000 的连接被拒绝? - Node.JS: Why is my connection to localhost:3000 refused? 终端卷曲:(7)无法连接到localhost端口3000:连接被拒绝 - Terminal curl: (7) Failed to connect to localhost port 3000: Connection refused Node & React - npm start - 正在运行但 localhost:3000 “无法访问” - Node & React - npm start - is running BUT localhost:3000 “cant be reached” 命令 `npm start` 什么都不做 - Command `npm start` does nothing npm 启动对 windows 没有任何作用 - npm start does nothing on windows react-boilerplate yarn start:prod无法访问此站点,本地主机拒绝连接。 http:// localhost:3000 => https:// localhost / - react-boilerplate yarn start:prod This site can’t be reached localhost refused to connect. http://localhost:3000 => https://localhost/ Node.js + Apache-https:// localhost:3000 / socket.io / ERR_CONNECTION_REFUSED - Node.js + Apache - https://localhost:3000/socket.io/ ERR_CONNECTION_REFUSED
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM