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

依照官网初始化项目 #5320

Open
littlegreay opened this issue May 29, 2024 · 1 comment
Open

依照官网初始化项目 #5320

littlegreay opened this issue May 29, 2024 · 1 comment

Comments

@littlegreay
Copy link

在此输入你需要反馈的 Bug 具体信息(Bug in Detail):

mkdir egg-example && cd egg-example
$ npm init egg --type=simple
$ npm i

我的node版本为21.2.0,
以上执行之后,npm run dev
或者sudo npm run dev出现如下问题

[email protected] dev
egg-bin dev

[egg-ts-helper] create typings/app/controller/index.d.ts (1ms)
[egg-ts-helper] create typings/config/index.d.ts (6ms)
[egg-ts-helper] create typings/config/plugin.d.ts (0ms)
[egg-ts-helper] create typings/app/index.d.ts (0ms)
2024-05-29 15:23:09,163 INFO 64093 [master] node version v21.2.0
2024-05-29 15:23:09,163 INFO 64093 [master] egg version 3.23.0
2024-05-29 15:23:09,373 INFO 64093 [master] agent_worker#1:64096 started (209ms)
2024-05-29 15:23:09,835 ERROR 64097 [app_worker] server got error: bind EADDRINUSE null:7001, code: EADDRINUSE
[2024-05-29 15:23:09.839] [cfork:master:64093] worker:64097 disconnect (exitedAfterDisconnect: false, state: disconnected, isDead: false, worker.disableRefork: true)
[2024-05-29 15:23:09.839] [cfork:master:64093] don't fork, because worker:64097 will be kill soon
2024-05-29 15:23:09,839 INFO 64093 [master] app_worker#1:64097 disconnect, suicide: false, state: disconnected, current workers: ["1"]
[2024-05-29 15:23:09.839] [cfork:master:64093] worker:64097 exit (code: 0, exitedAfterDisconnect: false, state: dead, isDead: true, isExpected: false, worker.disableRefork: true)
2024-05-29 15:23:09,840 ERROR 64093 nodejs.AppWorkerDiedError: [master] app_worker#1:64097 died (code: undefined, signal: null, suicide: false, state: dead), current workers: [64097]
at Master.onAppExit (/Users/greation/Desktop/code/node-spider/egg/node_modules/egg-cluster/lib/master.js:410:21)
at Master.emit (node:events:519:28)
at Messenger.sendToMaster (/Users/greation/Desktop/code/node-spider/egg/node_modules/egg-cluster/lib/utils/messenger.js:137:17)
at Messenger.send (/Users/greation/Desktop/code/node-spider/egg/node_modules/egg-cluster/lib/utils/messenger.js:102:12)
at EventEmitter. (/Users/greation/Desktop/code/node-spider/egg/node_modules/egg-cluster/lib/utils/mode/impl/process/app.js:114:22)
at EventEmitter.emit (node:events:531:35)
at ChildProcess. (node:internal/cluster/primary:188:13)
at Object.onceWrapper (node:events:634:26)
at ChildProcess.emit (node:events:519:28)
at ChildProcess._handle.onexit (node:internal/child_process:294:12)
name: "AppWorkerDiedError"
pid: 64093
hostname: greationdeAir

2024-05-29 15:23:09,840 ERROR 64093 [master] app_worker#1:64097 start fail, exiting with code:1
2024-05-29 15:23:09,840 ERROR 64093 [master] exit with code:1
2024-05-29 15:23:09,843 ERROR 64096 [agent_worker] receive disconnect event on child_process fork mode, exiting with code:110
2024-05-29 15:23:09,844 ERROR 64096 [agent_worker] exit with code:110
ForkError: /Users/greation/Desktop/code/node-spider/egg/node_modules/egg-bin/scripts/start-cluster.js {"baseDir":"/Users/greation/Desktop/code/node-spider/egg","workers":1,"port":7001,"framework":"/Users/greation/Desktop/code/node-spider/egg/node_modules/egg","sticky":false} exit with code 1
at ChildProcess. (/Users/greation/Desktop/code/node-spider/egg/node_modules/egg-bin/dist/cmd/base.js:98:33)
at Object.onceWrapper (node:events:634:26)
at ChildProcess.emit (node:events:519:28)
at ChildProcess._handle.onexit (node:internal/child_process:294:12) {
code: 1
}

可复现问题的仓库地址(Reproduction Repo)

暂无

Node 版本号:

21.2.0

Eggjs 版本号:

3.17.5

相关插件名称与版本号(PlugIn and Name):

0.0.0.

操作平台与版本号(Platform and Version):

mac m2

@svenjia
Copy link

svenjia commented Jun 3, 2024

7001端口被占了?改下端口试试

  config.cluster = {
    listen: {
      hostname: '0.0.0.0',
      port: 7001 // here
    }
  }

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

2 participants