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

服务器部署时执行'node index.js'运行失败 #25

Open
spencer-luo opened this issue Jun 17, 2024 · 6 comments
Open

服务器部署时执行'node index.js'运行失败 #25

spencer-luo opened this issue Jun 17, 2024 · 6 comments

Comments

@spencer-luo
Copy link

spencer-luo commented Jun 17, 2024

TypeError: Cannot read properties of undefined (reading 'setHeader')

discuss_run_error

@spencer-luo
Copy link
Author

Node.js: v20.9.0
Operation: MacOS 14.5

已配置MySQL数据库

@Lete114
Copy link
Member

Lete114 commented Jun 17, 2024

你能提供一下你的index.js和package.json的内容吗?

@spencer-luo
Copy link
Author

image image

@Lete114
Copy link
Member

Lete114 commented Jun 18, 2024

index.js的内容是这样的吗?

const discuss = require('discuss')

// 选择以什么方式运行
discuss.server() // 服务器使用 (Server)

@spencer-luo
Copy link
Author

是的:

const discuss = require('discuss')

// 选择以什么方式运行
discuss.server() // 服务器使用 (Server)

discuss.main() // 无服务器使用 (ServerLess)

@Lete114
Copy link
Member

Lete114 commented Jun 18, 2024

不需要 discuss.main()

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