简体   繁体   English

localhost:3000 在使用 npm start 时拒绝连接

[英]localhost:3000 refused to connect when using npm start

I am new to react and having a problem here.我是新手,在这里有问题。 Whenever I try to run my react app using npm start, I am getting these errors每当我尝试使用 npm start 运行我的 React 应用程序时,我都会收到这些错误

events.js:352
      throw er; // Unhandled 'error' event
      ^

Error: ENOSPC: System limit for number of file watchers reached, watch '/home/nrj/Documents/react/counter-app/public/favicon.ico'
    at FSWatcher.<computed> (internal/fs/watchers.js:218:26)
    at Object.watch (fs.js:1582:34)
    at createFsWatchInstance (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:38:15)
    at setFsWatchListener (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:233:14)
    at FSWatcher.NodeFsHandler._handleFile (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:262:21)
    at FSWatcher.<anonymous> (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:495:21)
    at FSReqCallback.oncomplete (fs.js:193:5)
Emitted 'error' event on FSWatcher instance at:
    at FSWatcher._handleError (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/index.js:260:10)
    at createFsWatchInstance (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:40:5)
    at setFsWatchListener (/home/nrj/Documents/react/counter-app/node_modules/webpack-dev-server/node_modules/chokidar/lib/nodefs-handler.js:81:15)
    [... lines matching original stack trace ...]
    at FSReqCallback.oncomplete (fs.js:193:5) {
  errno: -28,
  syscall: 'watch',
  code: 'ENOSPC',
  path: '/home/nrj/Documents/react/counter-app/public/favicon.ico',
  filename: '/home/nrj/Documents/react/counter-app/public/favicon.ico'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! counter-app@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the counter-app@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/nrj/.npm/_logs/2021-07-29T09_59_36_829Z-debug.log

I saw some solutions like updating node.js, deleting node_modules and running npm install, but they didn't work for me.我看到了一些解决方案,例如更新 node.js、删除 node_modules 和运行 npm install,但它们对我不起作用。

If you are running on Linux, it looks like you are exhausting the watchers limit如果你在 Linux 上运行,看起来你已经耗尽了观察者的限制

try following the instructions here: https://stackoverflow.com/a/55411444/2799454尝试按照此处的说明操作: https : //stackoverflow.com/a/55411444/2799454

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

相关问题 npm start 什么都不做 / localhost:3000 连接被拒绝 - npm start does nothing / localhost:3000 connection refused (7) 连接localhost 3000端口失败:连接被拒绝 - (7) Failed to connect to localhost port 3000: Connection refused react-boilerplate yarn start:prod无法访问此站点,本地主机拒绝连接。 http:// localhost:3000 =&gt; https:// localhost / - react-boilerplate yarn start:prod This site can’t be reached localhost refused to connect. http://localhost:3000 => https://localhost/ 与grapejs一起使用-是否“启动了npm”,但是localhost:8080将说无法访问此站点localhost拒绝连接 - with grapejs - did “npm start”, but localhost:8080 will say This site can’t be reached localhost refused to connect 终端卷曲:(7)无法连接到localhost端口3000:连接被拒绝 - Terminal curl: (7) Failed to connect to localhost port 3000: Connection refused “Localhost 拒绝连接”与 npm 启动 - “Localhost refuses to connect” with npm start Node &amp; React - npm start - 正在运行但 localhost:3000 “无法访问” - Node & React - npm start - is running BUT localhost:3000 “cant be reached” 使用 npm 和 reactjs 时在 localhost:3000 上获取空白页 - Getting Blank page on localhost:3000 while using npm along with reactjs 本地主机拒绝连接快递 - Localhost refused to connect express 本地主机拒绝在 chrome 中连接 - Localhost Refused to connect in chrome
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM