gpt4 book ai didi

javascript - 部署到 Cloud Foundry 的应用程序无法启动

转载 作者:行者123 更新时间:2023-12-03 00:34:37 26 4
gpt4 key购买 nike

我尝试将 Node.js 应用程序部署到 Bluemix,但失败了。

当我运行 cf logs IssueTracker --recent 时,我看到此错误:

   2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR module.js:549
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR throw err;
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR ^
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR Error: Cannot find module 'webpack'
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at Function.Module._resolveFilename (module.js:547:15)
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at Function.Module._load (module.js:474:25)
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at Module.require (module.js:596:17)
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at require (internal/module.js:11:18)
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at Object.<anonymous> (/home/vcap/app/dist/server.generated.js:1:6915)
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at r (/home/vcap/app/dist/server.generated.js:1:186)
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at Object.<anonymous> (/home/vcap/app/dist/server.generated.js:1:11679)
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at Object.<anonymous> (/home/vcap/app/dist/server.generated.js:1:12243)
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at r (/home/vcap/app/dist/server.generated.js:1:186)
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at Object.<anonymous> (/home/vcap/app/dist/server.generated.js:1:71669)
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at Object.<anonymous> (/home/vcap/app/dist/server.generated.js:1:73288)
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at r (/home/vcap/app/dist/server.generated.js:1:186)
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at Object.<anonymous> (/home/vcap/app/dist/server.generated.js:1:73356)
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at r (/home/vcap/app/dist/server.generated.js:1:186)
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at Object.<anonymous> (/home/vcap/app/dist/server.generated.js:1:73750)
2018-12-10T16:50:24.38+0000 [APP/PROC/WEB/0] ERR at r (/home/vcap/app/dist/server.generated.js:1:186)
2018-12-10T16:50:24.43+0000 [APP/PROC/WEB/0] ERR npm ERR! code ELIFECYCLE
2018-12-10T16:50:24.43+0000 [APP/PROC/WEB/0] ERR npm ERR! errno 1
2018-12-10T16:50:24.43+0000 [APP/PROC/WEB/0] ERR npm ERR! issue-tracker-pc@1.0.0 start: `NODE_ENV=production node ./dist/server.generated.js`
2018-12-10T16:50:24.43+0000 [APP/PROC/WEB/0] ERR npm ERR! Exit status 1
2018-12-10T16:50:24.43+0000 [APP/PROC/WEB/0] ERR npm ERR!
2018-12-10T16:50:24.43+0000 [APP/PROC/WEB/0] ERR npm ERR! Failed at the issue-tracker-pc@1.0.0 start script.
2018-12-10T16:50:24.43+0000 [APP/PROC/WEB/0] ERR npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-12-10T16:50:24.45+0000 [APP/PROC/WEB/0] ERR npm ERR! A complete log of this run can be found in:
2018-12-10T16:50:24.45+0000 [APP/PROC/WEB/0] ERR npm ERR! /home/vcap/app/.npm/_logs/2018-12-10T16_50_24_438Z-debug.log

我是 Cloud Foundry 的新手,所以不知道下一步该做什么。我该如何解决这个问题?

最佳答案

您的应用中似乎缺少依赖项:错误:找不到模块“webpack”

CF 运行来启动应用程序的命令是 NODE_ENV=生产 Node ./dist/server. generated.js。尝试在本地运行看看是否可以重现。

您可能还想尝试在干净的虚拟机上运行,​​以排除在开发人员工作站上全局安装缺少的依赖项的情况。当您的应用程序在 CF 上运行时,全局安装的依赖项将不可用。唯一可用的是 NPM/Yarn 根据您的 package.json 文件安装的内容。

希望有帮助!

关于javascript - 部署到 Cloud Foundry 的应用程序无法启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53714569/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com