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

代理端口号出错 #31

Closed
liuyong opened this issue Apr 17, 2018 · 6 comments
Closed

代理端口号出错 #31

liuyong opened this issue Apr 17, 2018 · 6 comments

Comments

@liuyong
Copy link

liuyong commented Apr 17, 2018

➜ vue-koa-demo git:(master) ✗ npm run dev && npm run server

vue-koa-demo@1.0.0 dev /Users/XNW/Documents/Vuejs_workspace/vue-koa-demo
node build/dev-server.js

[HPM] Proxy created: /auth -> http://localhost:8889
[HPM] Proxy created: /api -> http://localhost:8889

Starting dev server...

DONE Compiled successfully in 5084ms 17:02:41

Listening at http://localhost:8080

[HPM] Error occurred while trying to proxy request /auth/user from localhost:8080 to http://localhost:8889 (ECONNREFUSED) (https://nodejs.org/api/errors.html#errors_common_system_errors)

@Molunerfinn
Copy link
Owner

参考:#15
#8

  1. 请分开跑前端和后端的命令。
  2. 请注意你的env里的port 8889是否被其他进程占用。

@liuyong
Copy link
Author

liuyong commented Apr 17, 2018

➜ vue-koa-demo git:(master) ✗ npm run server

vue-koa-demo@1.0.0 server /Users/XNW/Documents/Vuejs_workspace/vue-koa-demo
nodemon -w app.js -w server server-entry.js

[nodemon] 1.12.1
[nodemon] to restart at any time, enter rs
[nodemon] watching: app.js /Users/XNW/Documents/Vuejs_workspace/vue-koa-demo/server/**/*
[nodemon] starting node server-entry.js
Koa is listening in undefined
rs
[nodemon] starting node server-entry.js
Koa is listening in undefined

试过换端口,losf查端口占用,重启等都一样是报这个错,单跑npm run server 提示 Koa is listening in undefined

@Molunerfinn
Copy link
Owner

请问你的.env文件长啥样?

@liuyong
Copy link
Author

liuyong commented Apr 17, 2018

文件 dev.env 内容是:
DB_USER=root
DB_PASSWORD=mysqlpwd
PORT=8887

Mac 10.13.4 系统

@Molunerfinn
Copy link
Owner

。。。并不能叫做dev.env必须叫做.env。文件名改一下吧。然后把PORT改成8889就行了。

@liuyong
Copy link
Author

liuyong commented Apr 18, 2018

嗯,正常跑起来了,感谢~~

This was referenced May 30, 2018
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