简体   繁体   English

Node & React - npm start - 正在运行但 localhost:3000 “无法访问”

[英]Node & React - npm start - is running BUT localhost:3000 “cant be reached”

(having node version 12 and npm version 6) (具有节点版本 12 和 npm 版本 6)

  • Backend: Node.js后端:Node.js
  • Front: React.js i cloned repository cd into the directory ran前面:React.js 我把repository cd 克隆到run 目录下

npm install (installing dependencies etc...)

and when i ran当我跑

npm start

and i get我明白了

[Ben@Mac:~/Desktop/test]$ npm start

> answers-entry-level-exam@1.0.0 start /Users/Ben/Desktop/test
> lerna run start --parallel

lerna notice cli v3.22.1
lerna info Executing command in 1 package: "npm run start"
@ans-exam/server: > @ans-exam/server@1.0.0 start 
/Users/Ben/Desktop/test/server
@ans-exam/server: > ts-node-dev index.ts
@ans-exam/server: Using ts-node version 8.5.2, typescript version 3.7.2
@ans-exam/server: server running 3232
  • which seems like the server is running okay看起来服务器运行正常
  • but localhost:3000 cant be reached not opening anything the first time it did open and there was a MacOS popup on the right side of the screen related to node ( i think that is the issue but cant figure out how to fix)但是无法访问 localhost:3000第一次打开时没有打开任何东西,并且屏幕右侧有一个与节点相关的 MacOS 弹出窗口(我认为这是问题,但不知道如何解决)

my package.json:我的 package.json:

{
 "name": "answers-entry-level-exam",
 "version": "1.0.0",
 "description": "",
 "main": "index.js",
 "scripts": {
 "b": "npm run bootstrap",
 "bootstrap": "lerna bootstrap",
 "test": "echo \"Error: no test specified\" && exit 1",
 "start": "lerna run start --parallel",
 "postinstall": "npm run bootstrap"
},
 "author": "",
 "license": "ISC",
 "devDependencies": {
 "lerna": "^3.22.1"
}
}

Thanks!谢谢!

Try localhost:3232.尝试本地主机:3232。 I see in your output server running 3232我在你的输出server running 3232看到server running 3232

我再次克隆了 repo 并修复了对所有试图提供帮助的人的干杯 :)

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

相关问题 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/ 反应:什么会阻止 'npm start' 工作。 localhost:3000 打不开 - REACT: what would stop 'npm start' from working. localhost:3000 doesn't open 节点:npm 开始:如何在 0.0.0.0:3000 上运行 - node: npm start: how to run on 0.0.0.0:3000 每当我在 React 应用程序上启动 npm 时,我总是会收到“某些东西已经在端口 3000 上运行” - I always get "something is already running on port 3000" whenever I do npm start on react app localhost:3000 在使用 npm start 时拒绝连接 - localhost:3000 refused to connect when using npm start npm start 什么都不做 / localhost:3000 连接被拒绝 - npm start does nothing / localhost:3000 connection refused 无法使用npm start反应应用程序 - Cant start react app with npm start 使用“npm run start”时节点运行不同的 React 应用程序 - Node running a different React application when using "npm run start" 使用node.js写入文件后无法访问此站点的本地主机 - localhost this site cant be reached after writing to a file, with node.js 节点js express框架无法启动npm - node js express framework cant start npm
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM