egg-ant-design-pro 示例在windows下运行出错

Created on 13 Apr 2018  ·  4Comments  ·  Source: eggjs/egg

  • Node Version: v8.10.0
  • Egg Version: v2.6.0
  • Plugin Name:
  • Plugin Version:
  • Platform: Win10
  • Mini Showcase Repository:

从官方版本库中同步的egg-ant-design-pro

错误信息

PS D:\project\egg-ant-design-pro> npm run dev

> [email protected] dev D:\project\egg-ant-design-pro
> egg-bin dev

2018-04-13 16:40:43,175 INFO 23512 [master] node version v8.10.0
2018-04-13 16:40:43,181 INFO 23512 [master] egg version 2.6.0
2018-04-13 16:40:43,856 INFO 23512 [master] agent_worker#1:30116 started (670ms)
2018-04-13 16:40:43,881 ERROR 30116 nodejs.ENOENTError: spawn roadhog ENOENT
    at _errnoException (util.js:1022:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
code: 'ENOENT'
errno: 'ENOENT'
syscall: 'spawn roadhog'
path: 'roadhog'
spawnargs: [ 'dev' ]
name: 'ENOENTError'
pid: 30116
hostname: DESKTOP-GB7SOFU

2018-04-13 16:40:44,654 INFO 23512 [master] egg started on http://127.0.0.1:7001 (1470ms)

同时经测试 examples\assets-with-roadhogexamples\assets-with-umi等示例在windows下也出现类似的错误。

初步估计是与egg-view-assets设置子进程环境变量不对有关

Most helpful comment

尝试用库cross_spawn代替egg-view-assets插件devServer中child_process对象的spawn可以解决问题

All 4 comments

Translation of this issue:


egg-ant-design-pro sample running in windows

  • Node Version: v8.10.0
  • Egg Version: v2.6.0
  • Plugin Name:
  • Plugin Version:
  • Platform: Win10
  • Mini Showcase Repository:

Synchronous egg-ant-design-pro from the official repository

Error message

PS D:\project\egg-ant-design-pro> npm run dev

> [email protected] dev D:\project\egg-ant-design-pro
> egg-bin dev

2018-04-13 16:40:43,175 INFO 23512 [master] node version v8.10.0
2018-04-13 16:40:43,181 INFO 23512 [master] egg version 2.6.0
2018-04-13 16:40:43,856 INFO 23512 [master] agent_worker#1:30116 started (670ms)
2018-04-13 16:40:43,881 ERROR 30116 nodejs.ENOENTError: spawn roadhog ENOENT
    At _errnoException (util.js:1022:11)
    At Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    At onErrorNT (internal/child_process.js:372:16)
    At _combinedTickCallback (internal/process/next_tick.js:138:11)
    At process._tickCallback (internal/process/next_tick.js:180:9)
Code: 'ENOENT'
Errno: 'ENOENT'
Syscall: 'spawn roadhog'
Path: 'roadhog'
Spawnargs: [ 'dev' ]
Name: 'ENOENTError'
Pid: 30116
Hostname: DESKTOP-GB7SOFU

2018-04-13 16:40:44,654 INFO 23512 [master] egg started on http://127.0.0.1:7001 (1470ms)

At the same time tested examples\assets-with-roadhog, examples such as ʻexamples\assets-with-umi` and similar errors in windows.

The preliminary estimate is related to the incorrect setting of the child process environment variable with egg-view-assets

A pull request is here, but we don't have time to check the problem.

尝试用库cross_spawn代替egg-view-assets插件devServer中child_process对象的spawn可以解决问题

egg-view-assets has use cross-spawn instead of spawn, you can have a try.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fengmk2 picture fengmk2  ·  51Comments

itsky365 picture itsky365  ·  62Comments

zlab picture zlab  ·  55Comments

popomore picture popomore  ·  53Comments

popomore picture popomore  ·  59Comments