doceker-compose up后yapi启动错误,mongo倒是可以

doceker-compose up后yapi启动错误,mongo倒是可以

internal/modules/cjs/loader.js:818

  throw err;

  ^


Error: Cannot find module '/my-yapi/vendors/server/app.js'

    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)

    at Function.Module._load (internal/modules/cjs/loader.js:667:27)

    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)

    at internal/main/run_main_module.js:17:47 {

  code: 'MODULE_NOT_FOUND',

  requireStack: []

}

internal/modules/cjs/loader.js:818

  throw err;

  ^


Error: Cannot find module '/my-yapi/vendors/server/app.js'

    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)

    at Function.Module._load (internal/modules/cjs/loader.js:667:27)

    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)

    at internal/main/run_main_module.js:17:47 {

  code: 'MODULE_NOT_FOUND',

  requireStack: []

}

internal/modules/cjs/loader.js:818

  throw err;

  ^


Error: Cannot find module '/my-yapi/vendors/server/app.js'

    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)

    at Function.Module._load (internal/modules/cjs/loader.js:667:27)

    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)

    at internal/main/run_main_module.js:17:47 {

  code: 'MODULE_NOT_FOUND',

  requireStack: []

}

internal/modules/cjs/loader.js:818

  throw err;

  ^


Error: Cannot find module '/my-yapi/vendors/server/app.js'

    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)

    at Function.Module._load (internal/modules/cjs/loader.js:667:27)

    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)

    at internal/main/run_main_module.js:17:47 {

  code: 'MODULE_NOT_FOUND',

  requireStack: []

}

internal/modules/cjs/loader.js:818

  throw err;

  ^


Error: Cannot find module '/my-yapi/vendors/server/app.js'

    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)

    at Function.Module._load (internal/modules/cjs/loader.js:667:27)

    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)

    at internal/main/run_main_module.js:17:47 {

  code: 'MODULE_NOT_FOUND',

  requireStack: []

}


正在回答 回答被采纳积分+1

登陆购买课程后可参与讨论,去登陆

4回答
Icecream_2021 2021-04-23 00:35:08

[问题复现] 

docker-compose up

出现编译错误
http://img1.sycdn.imooc.com//climg/6081a2090950071016010390.jpg


[原因] : 没有开启转发,网桥配置完后,需要开启转发,不然容器启动后,就会没有网络
[解决方案]:

vim /etc/sysctl.conf

#配置转发
net.ipv4.ip_forward=1

#重启服务,让配置生效
systemctl restart network

#查看是否成功,如果返回为“net.ipv4.ip_forward = 1”则表示成功

sysctl net.ipv4.ip_forward


_cp 2021-03-19 17:58:18

兄弟,使用这个可以

https://github.com/fjc0k/docker-YApi

慕瓜9466948 2021-03-17 18:26:16

一样的问题你解决了吗

bobby 2021-03-13 09:40:33

你留下qq 我加你看看

  • bobby #1

    这个问题是因为需要修改docker-compose.yml中的command命令,进入之后会有提示应该如何修改的

    2021-04-01 18:56:06
  • 老师,这个怎么解决呢?我的QQ 17696050130

    2021-04-21 22:00:28
  • 可以啦,谢谢老师啦。



    2021-04-21 22:29:40
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师