在Heroku中启动应用程序时找不到预言

时间:2018-10-21 09:14:52

标签: heroku preact

好的,所以我在将自己的preact应用程序安装到heroku时遇到问题。我将其连接到github,以便将其直接构建到heroku中,但不会超出预先准备的服务和构建。这是我的heroku日志。

2018-10-21T09:09:23.986026+00:00 heroku[web.1]: Starting process with command `npm start`
2018-10-21T09:09:27.624952+00:00 app[web.1]: 
2018-10-21T09:09:27.624970+00:00 app[web.1]: > portfolio-page@0.0.0 start /app
2018-10-21T09:09:27.624972+00:00 app[web.1]: > if-env NODE_ENV='production' && npm run serve || npm run dev
2018-10-21T09:09:27.624974+00:00 app[web.1]: 
2018-10-21T09:09:28.595955+00:00 app[web.1]: 
2018-10-21T09:09:28.595995+00:00 app[web.1]: > portfolio-page@0.0.0 serve /app
2018-10-21T09:09:28.595997+00:00 app[web.1]: > preact build && preact serve
2018-10-21T09:09:28.595999+00:00 app[web.1]: 
2018-10-21T09:09:28.605427+00:00 app[web.1]: sh: 1: preact: not found
2018-10-21T09:09:28.613622+00:00 app[web.1]: npm ERR! file sh
2018-10-21T09:09:28.613973+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-10-21T09:09:28.614303+00:00 app[web.1]: npm ERR! errno ENOENT
2018-10-21T09:09:28.614652+00:00 app[web.1]: npm ERR! syscall spawn
2018-10-21T09:09:28.617301+00:00 app[web.1]: npm ERR! portfolio-page@0.0.0 serve: `preact build && preact serve`
2018-10-21T09:09:28.617670+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-10-21T09:09:28.618022+00:00 app[web.1]: npm ERR! 
2018-10-21T09:09:28.618469+00:00 app[web.1]: npm ERR! Failed at the portfolio-page@0.0.0 serve script.
2018-10-21T09:09:28.618707+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-10-21T09:09:28.639567+00:00 app[web.1]: 
2018-10-21T09:09:28.639942+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-10-21T09:09:28.640124+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2018-10-21T09_09_28_621Z-debug.log
2018-10-21T09:09:29.383487+00:00 app[web.1]: 
2018-10-21T09:09:29.383495+00:00 app[web.1]: > portfolio-page@0.0.0 dev /app
2018-10-21T09:09:29.383497+00:00 app[web.1]: > preact watch
2018-10-21T09:09:29.383498+00:00 app[web.1]: 
2018-10-21T09:09:29.407743+00:00 app[web.1]: sh: 1: preact: not found
2018-10-21T09:09:29.430644+00:00 app[web.1]: npm ERR! file sh
2018-10-21T09:09:29.432029+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-10-21T09:09:29.433130+00:00 app[web.1]: npm ERR! errno ENOENT
2018-10-21T09:09:29.433981+00:00 app[web.1]: npm ERR! syscall spawn
2018-10-21T09:09:29.440231+00:00 app[web.1]: npm ERR! portfolio-page@0.0.0 dev: `preact watch`
2018-10-21T09:09:29.440955+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-10-21T09:09:29.442297+00:00 app[web.1]: npm ERR! 
2018-10-21T09:09:29.442980+00:00 app[web.1]: npm ERR! Failed at the portfolio-page@0.0.0 dev script.
2018-10-21T09:09:29.443660+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-10-21T09:09:29.470864+00:00 app[web.1]: 
2018-10-21T09:09:29.471185+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-10-21T09:09:29.471425+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2018-10-21T09_09_29_449Z-debug.log
2018-10-21T09:09:29.488189+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-10-21T09:09:29.489675+00:00 app[web.1]: npm ERR! errno 1
2018-10-21T09:09:29.497444+00:00 app[web.1]: npm ERR! portfolio-page@0.0.0 start: `if-env NODE_ENV='production' && npm run serve || npm run dev`
2018-10-21T09:09:29.497699+00:00 app[web.1]: npm ERR! Exit status 1
2018-10-21T09:09:29.498047+00:00 app[web.1]: npm ERR! 
2018-10-21T09:09:29.498289+00:00 app[web.1]: npm ERR! Failed at the portfolio-page@0.0.0 start script.
2018-10-21T09:09:29.498516+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-10-21T09:09:29.517653+00:00 app[web.1]: 
2018-10-21T09:09:29.521721+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-10-21T09:09:29.522301+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2018-10-21T09_09_29_507Z-debug.log
2018-10-21T09:09:29.630957+00:00 heroku[web.1]: State changed from starting to crashed
2018-10-21T09:09:29.608869+00:00 heroku[web.1]: Process exited with status 1
2018-10-21T09:09:31.210092+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=portfolio-page2.herokuapp.com request_id=e499628d-4990-47b8-9dbe-56cc75fe2a60 fwd="208.77.22.116" dyno= connect= service= status=503 bytes= protocol=https
2018-10-21T09:09:31.520483+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=portfolio-page2.herokuapp.com request_id=2a39f726-a35a-4356-96d5-4c2cde7661ca fwd="208.77.22.116" dyno= connect= service= status=503 bytes= protocol=https

我不知道如何查看完整的日志(如果它与本日志不一样),并且我有先见之明。

{
  "private": true,
  "name": "portfolio-page",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "start": "if-env NODE_ENV='production' && npm run serve || npm run dev",
    "build": "preact build",
    "serve": "preact build && preact serve",
    "dev": "preact watch",
    "lint": "eslint src",
    "styleguide": "styleguidist server",
    "styleguide:build": "styleguidist build"
  },
  "eslintConfig": {
    "extends": "eslint-config-synacor"
  },
  "eslintIgnore": [
    "build/*"
  ],
  "devDependencies": {
    "eslint": "^4.9.0",
    "eslint-config-synacor": "^2.0.2",
    "preact-cli": "^2.0.1",
    "react-styleguidist": "^6.1.0"
  },
  "dependencies": {
    "if-env": "^1.0.4",
    "preact": "^8.3.1",
    "preact-compat": "^3.17.0",
    "preact-router": "^2.5.7",
    "react-fa": "^5.0.0",
    "react-scripts": "^2.0.5",
    "react-transition-group": "^2.2.1"
  }
}

很抱歉,如果信息太少或太多,但是我对此还比较陌生,并且我已经为此工作了几天。我将为您提供一些指导。在Windows 10上使用VScode。

1 个答案:

答案 0 :(得分:0)

似乎没有安装依赖项npm install,而您直接运行npm start时,为什么会出现未找到精确错误的错误。