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

egg写的接口服务放到服务器上报500以及端口占用问题 #83

Open
lizhongzhen11 opened this issue Mar 10, 2020 · 0 comments

Comments

@lizhongzhen11
Copy link
Owner

lizhongzhen11 commented Mar 10, 2020

egg官网部署写的真不好,按照教程部署到linux服务器上,结果报500,我当时就懵逼了。

后来在 https://blog.csdn.net/shancofolia/article/details/86488022 找到答案,我用的是ts,需要先 npm run tsc 一下才能 npm start

注意,需要安装ts相关依赖,图省事的话,干脆直接在服务器 npm i 全给它安装了。

2020-03-11补充

今晚把允许跨域的来源于修改下,重新发布到服务器上,忘了先 npm stop 了,导致启动一直报错,报错如下:

起初我以为是发布的代码有问题,全删除,重新在服务器上 npm install 然后 npm run tsc 再然后 npm start,结果还是不行,遂将报错百度,发现是端口占用问题!!!

这时我才意识到,昨晚启动的服务没关闭,即使我删除了问题,但是node服务依然占用了7001端口!粗心大意啊。。。

知道问题就很简单了,晚上百度下怎么杀占用端口的进程即可!

@lizhongzhen11 lizhongzhen11 changed the title egg写的接口服务放到服务器上报500 egg写的接口服务放到服务器上报500以及端口占用问题 Mar 11, 2020
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

1 participant