eggjs / egg

🥚 Born to build better enterprise frameworks and apps with Node.js & Koa
https://eggjs.org
MIT License
18.88k stars 1.81k forks source link

idea, webstorm 修改后端代码后,不会自动重启 worker 进程 #428

Closed zlab closed 7 years ago

zlab commented 7 years ago

idea, webstorm 修改后端代码后,不会自动重启 worker 进程, 用记事本或其它工具修改,会自动重启

atian25 commented 7 years ago

我这边本地测试是没问题的

myfreax commented 7 years ago

把你的启动命令贴出看看

zlab commented 7 years ago

npm run dev

atian25 commented 7 years ago

系统环境啥的呢? 有用 vagrant 么?

zlab commented 7 years ago

图片

自动保存不会触发重启,ctrl+s也不会触发,我用webpack,gulp都是可以触发的

我直接用记事本修改文件,会自动重启

atian25 commented 7 years ago

正常启动会有个 watcher 的日志的:

2017-02-22 15:28:44,577 INFO 72081 [egg:watcher:agent] watcher start success
2017-02-22 15:28:44,584 INFO 72077 [master] Agent Worker started (559ms)

你试下重新安装依赖, 还有 egg-bin 不要装全局的.

$ rm -rf node_modules
$ npm i
$ npm run dev
atian25 commented 7 years ago

cc @shaoshuai0102

shaoshuai0102 commented 7 years ago

idea, webstorm 修改文件有啥特殊机制么。。

zlab commented 7 years ago

图片

在webstorm里面改不会重启,我在外面用记事本改,就会重启

zlab commented 7 years ago

idea, webstorm 我都试过了,不行, vs code, atom,记事本可以

jtyjty99999 commented 7 years ago

可能与这个有关系 http://stackoverflow.com/questions/34213253/webpack-watch-not-working-on-webstorm-on-windows 配置下不使用 safe write 试试

shaoshuai0102 commented 7 years ago

image

确实是这个原因。

试试解决办法:

  1. 关掉 safe write
  2. 尝试下 egg-watcher-chokidar 替换默认 watcher
zlab commented 7 years ago

ok了,谢谢各位,就是重启还是报一堆的错

2017-02-22 16:23:25,923 ERROR 186360 nodejs.ECONNRESETError: read ECONNRESET
    at exports._errnoException (util.js:1022:11)
    at TCP.onread (net.js:569:26)
code: 'ECONNRESET'
errno: 'ECONNRESET'
syscall: 'read'
name: 'ECONNRESETError'
pid: 186360
hostname: zhanqi-pc
shaoshuai0102 commented 7 years ago

重启报错在这里跟进 https://github.com/eggjs/egg/issues/432

atian25 commented 7 years ago

@zlab 你的解决方案是选择了哪一种

zlab commented 7 years ago

关掉 safe write 先用着吧,但是webpack确实不用 关掉 safe write 也是可以检测到的

naffan2014 commented 7 years ago

sublime 编写egg。iterm2 运行的npm run dev 也是不自动重启

Ailein commented 7 years ago

修改了文件 自动重启了 ,页面打不开了,一直在等待,卡住了。

Ailein commented 7 years ago

image image 新建的一个项目,没有动什么只是改了下hi, egg3, 环境 win10 node v6.10.2