将 Strapi 部署到 Heroku 时出现应用程序错误,但构建成功?

时间:2021-02-21 06:25:43

标签: node.js heroku strapi

我对 Strapi 真的很陌生,跟着 this tutorial 使用 MongoDB 和 Heroku 部署它。 Strapi 应用程序成功部署到 Heroku,但是当我打开它时,它说

“应用程序错误。应用程序发生错误,无法提供您的页面。如果您是应用程序所有者,请检查您的日志以了解详细信息。”

这是构建日志:

-----> Building on the Heroku-20 stack
-----> Node.js app detected
       
-----> Creating runtime environment
       
       NPM_CONFIG_LOGLEVEL=error
       USE_YARN_CACHE=true
       NODE_VERBOSE=false
       NODE_ENV=production
       NODE_MODULES_CACHE=true
       
-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)
       engines.yarn (package.json):  unspecified (use default)
       
       Resolving node version 14.x...
       Downloading and installing node 14.15.5...
       Using default npm version: 6.14.11
       Resolving yarn version 1.22.x...
       Downloading and installing yarn (1.22.10)
       Installed yarn 1.22.10
        !     node_modules checked into source control
              https://devcenter.heroku.com/articles/node-best-practices#only-git-the-important-bits
       
       
-----> Installing dependencies
       Installing node modules (yarn.lock)
       yarn install v1.22.10
       warning package.json: No license field
       warning No license field
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       [3/4] Linking dependencies...
       warning " > strapi-provider-upload-cloudinary@3.5.0" has unmet peer dependency "strapi-plugin-upload@^3.1.6".
       [4/4] Building fresh packages...
       Done in 6.43s.
       
-----> Build
       
-----> Pruning devDependencies
       yarn install v1.22.10
       warning package.json: No license field
       warning No license field
       [1/4] Resolving packages...
       [2/4] Fetching packages...
       [3/4] Linking dependencies...
       warning " > strapi-provider-upload-cloudinary@3.5.0" has unmet peer dependency "strapi-plugin-upload@^3.1.6".
       [4/4] Building fresh packages...
       warning Ignored scripts due to flag.
       Done in 0.72s.
       
-----> Caching build
       - yarn cache
       
-----> Build succeeded!
 !     This app may not specify any way to start a node process
       https://devcenter.heroku.com/articles/nodejs-support#default-web-process-type
 !     Unmet dependencies don't fail yarn install but may cause runtime issues
       https://github.com/npm/npm/issues/7494
-----> Discovering process types
       Procfile declares types     -> (none)
       Default types for buildpack -> web
-----> Compressing...
       Done: 34.8M
-----> Launching...
       Released v10
       https://we-the-genesis-strapi.herokuapp.com/ deployed to Heroku

这是 heroku logs 的输出:

2021-02-21T06:22:05.341700+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-21T06:22:50.951762+00:00 app[api]: Rollback to v10 by user merinetan@gmail.com
2021-02-21T06:22:50.951762+00:00 app[api]: Release v13 created by user merinetan@gmail.com
2021-02-21T06:22:52.245919+00:00 heroku[web.1]: State changed from crashed to starting
2021-02-21T06:22:54.607923+00:00 heroku[web.1]: Starting process with command `npm start`
2021-02-21T06:22:56.386071+00:00 app[web.1]: npm ERR! missing script: start
2021-02-21T06:22:56.394175+00:00 app[web.1]: 
2021-02-21T06:22:56.394498+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-02-21T06:22:56.394653+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-02-21T06_22_56_386Z-debug.log
2021-02-21T06:22:56.442808+00:00 heroku[web.1]: Process exited with status 1
2021-02-21T06:22:56.495544+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-21T06:25:45.223881+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=we-the-genesis-strapi.herokuapp.com request_id=3ed63d3e-e250-4626-b783-02203af73712 fwd="3.80.167.121" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T06:26:05.476448+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=HEAD path="/" host=we-the-genesis-strapi.herokuapp.com request_id=78bb4932-55ce-49aa-b9ad-11ff1e09a70f fwd="217.182.175.162" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T06:28:23.814694+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/robots.txt" host=we-the-genesis-strapi.herokuapp.com request_id=9a3d44c0-03f4-4b27-9f43-f61c232ad732 fwd="107.23.45.127" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T06:28:24.092182+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=we-the-genesis-strapi.herokuapp.com request_id=8a12e8ff-6d68-4265-96f7-69a8696c25a7 fwd="107.23.45.127" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T06:30:18.240690+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=we-the-genesis-strapi.herokuapp.com request_id=a2033709-b957-4be0-ab71-c6b987bbf3ab fwd="193.27.12.68" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T06:30:24.317897+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=we-the-genesis-strapi.herokuapp.com request_id=f4ab55e4-9e7c-4a29-8117-9cbdb53fc20e fwd="193.27.12.68" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T06:35:39.745213+00:00 heroku[web.1]: State changed from crashed to starting
2021-02-21T06:35:42.237997+00:00 heroku[web.1]: Starting process with command `npm start`
2021-02-21T06:35:44.215838+00:00 app[web.1]: npm ERR! missing script: start
2021-02-21T06:35:44.221068+00:00 app[web.1]: 
2021-02-21T06:35:44.221326+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-02-21T06:35:44.221405+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-02-21T06_35_44_216Z-debug.log
2021-02-21T06:35:44.270848+00:00 heroku[web.1]: Process exited with status 1
2021-02-21T06:35:44.328081+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-21T06:36:24.094434+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=we-the-genesis-strapi.herokuapp.com request_id=3c048bbc-721a-4b96-bd5c-15eaab20b7d1 fwd="193.27.12.68" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T06:36:25.661453+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=we-the-genesis-strapi.herokuapp.com request_id=870ef876-31f7-4e52-9b25-c9ec0c4d6cb8 fwd="193.27.12.68" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T06:36:29.413655+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=we-the-genesis-strapi.herokuapp.com request_id=249b6bdb-6d8d-4890-b6e0-ad6aa7555578 fwd="193.27.12.68" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T06:36:29.981010+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=we-the-genesis-strapi.herokuapp.com request_id=8fd73cd3-b900-42a0-b28c-d5a940c2ef06 fwd="193.27.12.68" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T06:48:56.447385+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=we-the-genesis-strapi.herokuapp.com request_id=d581c5b1-da4a-455b-8b3b-527494420dad fwd="193.27.12.68" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T06:48:58.252921+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=we-the-genesis-strapi.herokuapp.com request_id=8e7c0f9a-d11e-4542-aff0-c466f61300ce fwd="193.27.12.68" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T07:00:03.313920+00:00 heroku[web.1]: State changed from crashed to starting
2021-02-21T07:00:06.449360+00:00 heroku[web.1]: Starting process with command `npm start`
2021-02-21T07:00:09.380555+00:00 app[web.1]: npm ERR! missing script: start
2021-02-21T07:00:09.385558+00:00 app[web.1]: 
2021-02-21T07:00:09.385832+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-02-21T07:00:09.385944+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-02-21T07_00_09_381Z-debug.log
2021-02-21T07:00:09.471304+00:00 heroku[web.1]: Process exited with status 1
2021-02-21T07:00:09.542349+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-21T07:50:27.036632+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=we-the-genesis-strapi.herokuapp.com request_id=07fdd52d-a5da-41ba-aa04-f9709c15c1cd fwd="193.27.12.68" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T07:55:10.471814+00:00 heroku[web.1]: State changed from crashed to starting
2021-02-21T07:55:13.315292+00:00 heroku[web.1]: Starting process with command `npm start`
2021-02-21T07:55:15.630158+00:00 app[web.1]: npm ERR! missing script: start
2021-02-21T07:55:15.639782+00:00 app[web.1]: 
2021-02-21T07:55:15.640206+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-02-21T07:55:15.640407+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-02-21T07_55_15_631Z-debug.log
2021-02-21T07:55:15.691414+00:00 heroku[web.1]: Process exited with status 1
2021-02-21T07:55:15.759805+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-21T07:56:03.843654+00:00 heroku[web.1]: State changed from crashed to starting
2021-02-21T09:38:30.628336+00:00 heroku[web.1]: State changed from crashed to starting
2021-02-21T09:38:33.486003+00:00 heroku[web.1]: Starting process with command `npm start`
2021-02-21T09:38:37.077175+00:00 app[web.1]: npm ERR! missing script: start
2021-02-21T09:38:37.083975+00:00 app[web.1]: 
2021-02-21T09:38:37.084256+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-02-21T09:38:37.084355+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-02-21T09_38_37_077Z-debug.log
2021-02-21T09:38:37.151682+00:00 heroku[web.1]: Process exited with status 1
2021-02-21T09:38:37.210620+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-21T10:02:04.794170+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=HEAD path="/" host=we-the-genesis-strapi.herokuapp.com request_id=8d7e9a50-825d-4ace-9433-2a0e1aecd135 fwd="217.182.175.162" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T12:23:54.511630+00:00 heroku[web.1]: State changed from crashed to starting
2021-02-21T12:23:58.090780+00:00 heroku[web.1]: Starting process with command `npm start`
2021-02-21T12:24:01.254908+00:00 app[web.1]: npm ERR! missing script: start
2021-02-21T12:24:01.263262+00:00 app[web.1]: 
2021-02-21T12:24:01.263926+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-02-21T12:24:01.264231+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-02-21T12_24_01_255Z-debug.log
2021-02-21T12:24:01.315068+00:00 heroku[web.1]: Process exited with status 1
2021-02-21T12:24:01.404682+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-21T12:53:08.465603+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=we-the-genesis-strapi.herokuapp.com request_id=5b79c5f7-0c59-4e42-ad30-95828185385b fwd="182.253.245.120" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T12:53:10.017483+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=we-the-genesis-strapi.herokuapp.com request_id=e0d2774b-915a-41e1-b54b-1b13f8af4991 fwd="182.253.245.120" dyno= connect= service= status=503 bytes= protocol=https
2021-02-21T17:49:02.615126+00:00 heroku[web.1]: State changed from crashed to starting
2021-02-21T17:49:05.568155+00:00 heroku[web.1]: Starting process with command `npm start`
2021-02-21T17:49:08.048349+00:00 app[web.1]: npm ERR! missing script: start
2021-02-21T17:49:08.055280+00:00 app[web.1]: 
2021-02-21T17:49:08.055495+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-02-21T17:49:08.055581+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-02-21T17_49_08_049Z-debug.log
2021-02-21T17:49:08.101618+00:00 heroku[web.1]: Process exited with status 1
2021-02-21T17:49:08.181685+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-21T23:41:17.655463+00:00 heroku[web.1]: State changed from crashed to starting
2021-02-21T23:41:20.342548+00:00 heroku[web.1]: Starting process with command `npm start`
2021-02-21T23:41:22.677531+00:00 app[web.1]: npm ERR! missing script: start
2021-02-21T23:41:22.685929+00:00 app[web.1]: 
2021-02-21T23:41:22.686316+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-02-21T23:41:22.686514+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-02-21T23_41_22_678Z-debug.log
2021-02-21T23:41:22.747850+00:00 heroku[web.1]: Process exited with status 1
2021-02-21T23:41:22.811171+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-22T05:33:36.567171+00:00 heroku[web.1]: State changed from crashed to starting
2021-02-22T05:33:38.989078+00:00 heroku[web.1]: Starting process with command `npm start`
2021-02-22T05:33:41.308054+00:00 app[web.1]: npm ERR! missing script: start
2021-02-22T05:33:41.315909+00:00 app[web.1]: 
2021-02-22T05:33:41.316276+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-02-22T05:33:41.316446+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-02-22T05_33_41_308Z-debug.log
2021-02-22T05:33:41.360219+00:00 heroku[web.1]: Process exited with status 1
2021-02-22T05:33:41.409789+00:00 heroku[web.1]: State changed from starting to crashed
2021-02-22T11:25:55.927138+00:00 heroku[web.1]: State changed from crashed to starting
2021-02-22T11:25:58.546244+00:00 heroku[web.1]: Starting process with command `npm start`
2021-02-22T11:26:00.817024+00:00 app[web.1]: npm ERR! missing script: start
2021-02-22T11:26:00.825946+00:00 app[web.1]: 
2021-02-22T11:26:00.826186+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-02-22T11:26:00.826277+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2021-02-22T11_26_00_817Z-debug.log
2021-02-22T11:26:00.864484+00:00 heroku[web.1]: Process exited with status 1
2021-02-22T11:26:00.927770+00:00 heroku[web.1]: State changed from starting to crashed

谢谢!

0 个答案:

没有答案