heroku构建成功运行。 这是我的package.json 该应用程序在开发中运行良好,但在heroku平台上却报错
"name": "blog", "version": "0.0.0", "scripts": { "ng": "ng", "start": "node dist/blog/server/main.js", "build": "ng build", "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", "dev:ssr": "ng run blog:serve-ssr", "serve:ssr": "node dist/blog/server/main.js", "build:ssr": "ng build --prod && ng run blog:server:production", "prerender": "ng run blog:prerender" },
我得到的heroku日志。 我该如何解决这个错误?
internal/modules/cjs/loader.js:969
throw err;
^
Error: Cannot find module '/app/dist/blog/server/main.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
at Function.Module._load (internal/modules/cjs/loader.js:842:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! blog@0.0.0 start: `node dist/blog/server/main.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the blog@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /app/.npm/_logs/2020-06-29T21_26_22_651Z-debug.log
Starting process with command 'npm start'
这个错误对我来说很忙,我从Firebase部署中也遇到了同样的错误,所以我决定尝试一下heroku