at=错误代码=H10 desc= "App crashed" on heroku。如何真正部署?我如何解决问题?谢谢大家



2021-02-04T21:34.888815+00:00 app[web.1]:在模块_compile(internal/modules/cjs/loader.js:1156:30)2021-02-04T21:14:34.888815+00:00 app[web.1]:在Object.Module_extensions..js(internal/modules/cjs/loader.js:1176:10)2021-02-04T21:14:34.888815+00:00 app[web.1]:在Module.load(internal/modules/cjs/loader.js:100:32)2021-02-04T21:14:34.888816+00:00 app[web.1]:在Function.Module_load(internal/modules/cjs/loader.js:889:14)2021-02-04T21:14:34.888816+00:00 app[web.1]:在Function.executeUserEntryPoint[as-runMain](internal/modules/run_main.js:74:12){2021-02-04T21:14:34.888816+000:00 app[web.1]:代码:'MODULE_NOT_FOUND',2021-02-04T21:14:34.888817+00:0 app[web.1]:requireStack:['/app/server.js']2021-02-04T21:14:34.888817+00:00应用程序[web.1]:}2021-02-04T21:14:34.939405+00:00 heroku[web.1]:进程已退出,状态为12021-02-04T21:14:34.986938+00:00 heroku[web.1]:状态从启动更改为崩溃2021-02-04T21:15:03.000000+000:00 app[api]:由用户启动构建2021-02-04T21:20:20.4449954+00:00 app[api]:用户部署21abf2c82021-02-04T21:20:20.4449954+00:00-app[api]:用户创建的版本v72021-02-04T21:20:21.611307+00:0 heroku[web.1]:状态从崩溃变为启动2021-02-04T21:20:27.675645+000:00 heroku[web.1]:使用命令node server.js启动进程2021-02-04T21:20:30.295117+00:0 app[web.1]:节点:internal/modules/cjs/loader:9282021-02-04T21:20:30.295138+00:0 app[web.1]:抛出错误;2021-02-04T21:20:30.295138+000:00应用程序[web.1]:^2021-02-04T21:20:30.295138+000:00应用程序[web.1]:2021-02-04T21:20:30.295139+00:0 app[web.1]:错误:找不到模块"webpack"2021-02-04T21:20:30.295139+00:0 app[web.1]:需要堆栈:2021-02-04T21:20:30.295139+00:0 app[web.1]:-/app/server.js2021-02-04T21:20:30.295140+00:0 app[web.1]:位于Function.Module.resolveFilename(节点:internal/modules/cjs/loader:925:15)2021-02-04T21:20:30.295141+00:0 app[web.1]:在Function.Module_load(节点:internal/modules/cjs/loader:769:27)2021-02-04T21:20:30.295141+00:0 app[web.1]:在Module.require(节点:internal/modules/cjs/loader:997:19)2021-02-04T21:20:30.295141+00:0 app[web.1]:需要时(节点:internal/modules/cjs/helpers:92:18)2021-02-04T21:20:30.295142+00:0 app[web.1]:在对象处。(/app/server.js:3:17)2021-02-04T21:20:30.295142+00:0 app[web.1]:在模块_compile(节点:internal/modules/cjs/loader:1108:14)2021-02-04T21:20:30.295142+00:0 app[web.1]:在Object.Module_extensions..js(节点:internal/modules/cjs/loader:1137:102021-02-04T21:20:30.295143+00:0 app[web.1]:在Function.Module_load(节点:internal/modules/cjs/loader:813:14)2021-02-04T21:20:30.295143+00:0 app[web.1]:在Function.executeUserEntryPoint[as-runMain](节点:internal/modules/run_main:76:12){2021-02-04T21:20:30.295143+00:0 app[web.1]:代码:'MODULE_NOT_FOUND',2021-02-04T21:20:30.295144+00:0 app[web.1]:requireStack:['/app/server.js']2021-02-04T21:20:30.295144+00:0应用程序[web.1]:}2021-02-04T21:20:30.345918+000:00 heroku[web.1]:进程已退出,状态为12021-02-04T21:20:30.384592+00:0 heroku[web.1]:状态从启动更改为崩溃2021-02-04T21:20:34.000000+000:00 app[api]:生成成功2021-02-04T21:02.683135+000:00 heroku[路由器]:at=错误代码=H10 desc=";应用程序崩溃";method=GET path="/"host=ibeggg.herokuapp.com request_id=d281c400-d1b2-43fd-810b-b5d050ea7e11 fwd=";88.229.116.225〃;dyno=连接=服务=状态=503字节=协议=https2021-02-04T21:02.994155+000:00 heroku[路由器]:at=错误代码=H10 desc=";应用程序崩溃";method=GET path="/favicon.ico";host=ibeggg.herokuapp.com request_id=3a6125c6-23f7-4c18-8de7-f00a7bd86abb fwd=";88.229.116.225〃;dyno=连接=服务=状态=503字节=协议=https2021-02-04T21:28:25.25258+00:0 app[api]:用户用命令printenv启动进程2021-02-04T21:28:31.185921+00:00 heroku[run.7047]:等待客户2021-02-04T21:28:31.198973+00:0 heroku[run.7047]:状态从开始变为开始2021-02-04T21:28:31.470030+000:00 heroku[run.7047]:使用命令printenv启动进程2021-02-04T21:28:35.582815+000:00 heroku[run.7047]:进程已退出,状态为02021-02-04T21:28:35.613815+000:00 heroku[run.7047]:状态已从向上更改为完成2021-02-04T21:37:37.000000+000:00 app[api]:由用户启动构建2021-02-04T21:42:37.645366+00:0 app[api]:用户部署33855d7b2021-02-04T21:42:37.645366+00:0 app[api]:用户创建的版本v82021-02-04T21:42:39.338912+00:0 heroku[web.1]:状态从崩溃变为启动2021-02-04T21:42:46.215776+00:0 heroku[web.1]:使用命令node server.js启动进程2021-02-04T21:42:48.281568+00:00 app[web.1]:节点:internal/modules/cjs/loader:9282021-02-04T21:42:48.281609+00:00 app[web.1]:抛出错误;2021-02-04T21:42:48.281610+00:00应用程序[web.1]:^2021-02-04T21:42:48.281610+00:00应用程序[web.1]:2021-02-04T21:42:48.281611+00:0 app[web.1]:错误:找不到模块"express"2021-02-04T21:42:48.281611+00:0 app[web.1]:需要堆栈:2021-02-04T21:42:48.281616+00:0 app[web.1]:-/app/server.js2021-02-04T21:42:48.281620+000:00 app[web.1]:位于Function.Module.resolveFilename(节点:internal/modules/cjs/loader:925:15)2021-02-04T21:42:48.281625+00:00 app[web.1]:在Function.Module_load(节点:internal/modules/cjs/loader:769:27)2021-02-04T21:42:48.281633+000:00 app[web.1]:在Module.require(节点:internal/modules/cjs/loader:997:19)2021-02-04T21:42:48.281634+00:0 app[web.1]:需要时(节点:internal/modules/cjs/helpers:92:18)2021-02-04T21:42:48.281634+00:0 app[web.1]:在对象处。(/app/server.js:2:17)2021-02-04T21:42:48.281634+00:0 app[web.1]:在模块_compile(节点:internal/modules/cjs/loader:1108:14)2021-02-04T21:42:48.281635+00:0 app[web.1]:在Object.Module_extensions..js(节点:internal/modules/cjs/loader:1137:10)2021-02-04T21:42:48.281635+000:00 app[web.1]:在Function.Module_load(节点:internal/modules/cjs/loader:813:14)2021-02-04T21:42:48.281636+000:00 app[web.1]:在Function.executeUserEntryPoint[as-runMain](节点:internal/modules/run_main:76:12){2021-02-04T21:42:48.281636+00:0 app[web.1]:代码:'MODULE_NOT_FOUND',2021-02-04T21:42:48.281636+00:0 app[web.1]:requireStack:['/app/server.js']2021-02-04T21:42:48.281636+00:0应用程序[web.1]:}2021-02-04T21:42:48.381857+00:0 heroku[web.1]:进程已退出,状态为12021-02-04T21:42:48.421596+00:0 heroku[web.1]:状态从启动更改为崩溃2021-02-04T21:42:48.424452+00:0 heroku[web.1]:状态从崩溃变为启动2021-02-04T21:42:50.00000000+000:00 app[api]:生成成功2021-02-04T21:42:53.416520+00:0 heroku[web.1]:使用命令node server.js启动进程2021-02-04T21:42:54.764452+00:0 app[web.1]:节点:internal/modules/cjs/loader:9282021-02-04T21:42:54.764468+00:0 app[web.1]:抛出错误;2021-02-04T21:42:54.764469+00:0应用程序[web.1]:^2021-02-04T21:42:54.764470+00:0应用程序[web.1]:2021-02-04T21:42:54.764470+00:0 app[web.1]:错误:找不到模块"express"2021-02-04T21:42:54.764470+00:0 app[web.1]:需要堆栈:2021-02-04T21:42:54.764471+00:0 app[web.1]:-/app/server.js2021-02-04T21:42:54.764472+00:0 app[web.1]:位于Function.Module.resolveFilename(节点:internal/modules/cjs/loader:925:15)2021-02-04T21:42:54.764472+000:00 app[web.1]:在Function.Module_load(节点:internal/modules/cjs/loader:769:27)2021-02-04T21:42:54.764473+00:0 app[web.1]:在Module.require(节点:internal/modules/cjs/loader:997:19)2021-02-04T21:42:54.764473+00:0 app[web.1]:需要时(节点:internal/modules/cjs/helpers:92:18)2021-02-04T21:42:54.764474+00:0 app[web.1]:在对象处。(/app/server.js:2:17)2021-02-04T21:42:54.764474+00:0 app[web.1]:在模块_compile(节点:internal/modules/cjs/loader:1108:14)2021-02-04T21:42:54.764474+00:0 app[web.1]:在Object.Module_extensions..js(节点:internal/modules/cjs/loader:1137:10)2021-02-04T21:42:54.764475+00:0 app[web.1]:在Function.Module_load(节点:internal/modules/cjs/loader:813:14)2021-02-04T21:42:54.764475+00:0 app[web.1]:在Function.executeUserEntryPoint[as-runMain](节点:internal/modules/run_main:76:12){2021-02-04T21:42:54.764476+00:0 app[web.1]:代码:'MODULE_NOT_FOUND',2021-02-04T21:42:54.764476+00:0 app[web.1]:requireStack:['/app/server.js']2021-02-04T21:42:54.764476+00:0应用程序[web.1]:}2021-02-04T21:42:54.783537+00:0 heroku[web.1]:状态从启动更改为崩溃2021-02-04T21:42:54.805161+000:00 heroku[web.1]:进程已退出,状态为12021-02-04T21:43:39.306196+000:00 heroku[路由器]:at=错误代码=H10 desc=";应用程序崩溃";method=GET path="/"host=ibeggg.herokuapp.com request_id=6c4f76c5-ce13-407f-849f-50c996a70f84 fwd=";88.229.116.225〃;dyno=连接=服务=状态=503字节=协议=https2021-02-04T21:43:39.952043+00:0 heroku[路由器]:at=错误代码=H10 desc=";应用程序崩溃";method=GET path="/favicon.ico";host=ibeggg.herokuapp.com request_id=b46ee43b-b1c4-4d70-8172-e983ebbe7784 fwd=";88.229.116.225〃;dyno=连接=服务=状态=503字节=协议=https

My package.json:
{
"name": "chat-web-sdk-react-sample",
"private": true,
"version": "0.0.1",
"description": "Zopim Web SDK Sample App (React)",
"main": "server.js",
"scripts": {
"clean": "rimraf dist/*",
"copy": "copyfiles -f ./src/index.html ./dist",
"dist": "npm run copy & webpack --env=dist",
"lint": "eslint ./src",
"posttest": "npm run lint",
"serve": "node server.js --env=dev",
"serve:dist": "node server.js --env=dist",
"start": "node server.js --env=dev",
"storybook": "start-storybook -p 6006",
"build-storybook": "build-storybook"
},
"keywords": [],
"author": "Zendesk",
"engineStrict": true,
"engines": {
"node": ">=4.5.0"
},
"devDependencies": {
"@storybook/addon-actions": "^6.1.14",
"@storybook/addon-essentials": "^6.1.14",
"@storybook/addon-links": "^6.1.14",
"@storybook/react": "^6.1.14",
"@zendeskgarden/tailwindcss": "^1.1.0",
"autoprefixer": "^6.4.0",
"babel-core": "^6.0.0",
"babel-eslint": "^6.0.0",
"babel-loader": "^6.0.0",
"babel-plugin-transform-class-properties": "^6.11.5",
"babel-plugin-transform-object-rest-spread": "^6.8.0",
"babel-polyfill": "^6.3.14",
"babel-preset-es2015": "^6.0.15",
"babel-preset-react": "^6.0.15",
"bower-webpack-plugin": "^0.1.9",
"copyfiles": "^0.2.1",
"css-loader": "^0.23.0",
"eslint": "^2.2.0",
"eslint-loader": "^1.0.0",
"eslint-plugin-react": "^5.0.0",
"file-loader": "^0.8.4",
"glob": "^7.0.0",
"minimist": "^1.2.0",
"node-sass": "^4.13.1",
"null-loader": "^0.1.1",
"open": "0.0.5",
"postcss": "^5.0.11",
"postcss-loader": "^0.8.0",
"react-addons-test-utils": "^15.0.0",
"react-hot-loader": "^1.2.9",
"rimraf": "^2.4.3",
"sass-loader": "^3.1.2",
"style-loader": "^0.13.0",
"url-loader": "^0.5.6",
"webpack": "^1.12.0",
"webpack-dev-server": "^1.12.0"
},
"dependencies": {
"@babel/polyfill": "^7.6.0",
"@zendeskgarden/container-modal": "^0.8.5",
"@zendeskgarden/container-schedule": "^1.3.7",
"@zendeskgarden/css-variables": "^6.4.5",
"@zendeskgarden/react-accordions": "^8.30.0",
"@zendeskgarden/react-theming": "^8.30.0",
"@zendeskgarden/svg-icons": "^6.27.0",
"classnames": "^2.2.5",
"collections": "^2.0.3",
"core-js": "^3.8.3",
"graphql": "^15.4.0",
"lodash": "^4.15.0",
"prop-types": "^15.7.2",
"react": "^15.7.0",
"react-addons-css-transition-group": "^15.3.1",
"react-dom": "^15.7.0",
"react-redux": "^4.4.5",
"redux": "^3.5.2",
"store": "^1.3.20",
"storybook-host": "^5.2.0",
"styled-components": "^5.2.1",
"tailwindcss": "^1.2.0",
"websocket": "^1.0.33",
"wss": "^3.3.4"
},
"license": "ISC"
}
my server.js :
'use strict';
const express = require('express');
const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const config = require('./webpack.config');
const app = express();
const open = require('open');
const ip_address = '127.0.0.1';
const PORT = process.env.PORT;
new WebpackDevServer(webpack(config), config.devServer)
.listen(process.env.PORT , ip_address, (err) => {
if (err) {
console.log(err);
}
console.log(__dirname);
//=> '/Users/sindresorhus/rainbow'

console.log(process.cwd());
//=> '/Users/sindresorhus/unicorn'
//=> '/Users/sindresorhus/unicorn/foo.js'
console.log(`Listening at ${ip_address}:${process.env.PORT}`);
console.log('Opening your system browser...');
open(`http://${ip_address}:${process.env.PORT}/webpack-dev-server/`);
});

package.json中缺少express。此外,webpackwebpack-dev-serverdevDependencies,Heroku可能没有安装。

运行

npm i --save express webpack webpack-dev-server

然后提交并推送您的package.jsonpackage-lock.json并重新部署。

如果运行后webpackwebpack-dev-server不在dependencies下,而是在package.json中的devDependencies,则运行npm uninstall webpack webpack-dev-server,然后再次运行该命令。

相关内容

  • 没有找到相关文章

最新更新