Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Heroku无法启动应用程序-接收语法错误_Heroku_Nodemon_Heroku Ci - Fatal编程技术网

Heroku无法启动应用程序-接收语法错误

Heroku无法启动应用程序-接收语法错误,heroku,nodemon,heroku-ci,Heroku,Nodemon,Heroku Ci,我有一个Nodejs应用程序,在我的本地机器上运行良好。我正试图部署到Heroku。部署工作正常,但应用程序无法启动。我用的是膝关节炎和Typescript。我首先收到一个“nodemonnotfound错误”,并添加了一个Procfile来解决这个问题。然而,我不知道如何解决这个新错误 我直接从Github部署它(例如,我推到Git并从那里部署到Heroku) 谢谢你的关注 Heroku日志错误 019-06-24T10:55:35.628075+00:00 heroku[web.1]: St

我有一个Nodejs应用程序,在我的本地机器上运行良好。我正试图部署到Heroku。部署工作正常,但应用程序无法启动。我用的是膝关节炎和Typescript。我首先收到一个“nodemonnotfound错误”,并添加了一个Procfile来解决这个问题。然而,我不知道如何解决这个新错误

我直接从Github部署它(例如,我推到Git并从那里部署到Heroku)

谢谢你的关注

Heroku日志错误

019-06-24T10:55:35.628075+00:00 heroku[web.1]: State changed from crashed to starting
2019-06-24T10:55:40.080980+00:00 heroku[web.1]: Starting process with command `node src/server.ts`                  )
2019-06-24T10:55:42.382747+00:00 heroku[web.1]: State changed from starting to crashed
2019-06-24T10:55:42.361956+00:00 heroku[web.1]: Process exited with status 1
2019-06-24T10:55:42.287058+00:00 app[web.1]: /app/src/server.ts:1
2019-06-24T10:55:42.287088+00:00 app[web.1]: import { config } from './config/config';
2019-06-24T10:55:42.287091+00:00 app[web.1]: ^
2019-06-24T10:55:42.287093+00:00 app[web.1]:
2019-06-24T10:55:42.287094+00:00 app[web.1]: SyntaxError: Unexpected token {
2019-06-24T10:55:42.287097+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:721:23)
2019-06-24T10:55:42.287099+00:00 app[web.1]: at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
2019-06-24T10:55:42.287101+00:00 app[web.1]: at Module.load (internal/modules/cjs/loader.js:653:32)
2019-06-24T10:55:42.287103+00:00 app[web.1]: at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
2019-06-24T10:55:42.287105+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:585:3)
2019-06-24T10:55:42.287106+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
2019-06-24T10:55:42.287108+00:00 app[web.1]: at startup (internal/bootstrap/node.js:283:19)
2019-06-24T10:55:42.287111+00:00 app[web.1]: at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
Procfile

web: node src/server.ts
tsconfig.json

{
    "compileOnSave": false,
    "compilerOptions": {
      "paths": { "*": ["types/*"] },
      "noImplicitAny": false,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "moduleResolution" : "node",
      "lib": [
        "es2018"
      ],
      "types": [
        "node"
      ],
      "sourceMap": true,
      "baseUrl": "./src"
    },
    "exclude": [
      "node_modules",
      "**/*.spec.ts"
    ]
  }
{
  "name": "graphql-api",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "test": "cross-env NODE_PATH=./src mocha --timeout 25000 --exit -r ts-node/register ./test/**/*.test.ts",
    "start": "nodemon"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "nodemon": "^1.19.1",
    "typescript": "^3.5.1",
    "chai": "^4.2.0",
    "chai-http": "^4.3.0",
    "mocha": "^6.1.4"
  },
  "dependencies": {
    "@babel/runtime": "^7.4.5",
    "@types/mocha": "^5.2.7",
    "@types/neo4j": "^2.0.2",
    "apollo-server": "^2.6.2",
    "apollo-server-koa": "^2.6.3",
    "babel-plugin-transform-runtime": "^6.23.0",
    "bcryptjs": "^2.4.3",
    "dotenv": "^8.0.0",
    "fs": "0.0.1-security",
    "graphql": "^14.3.1",
    "graphql-voyager": "^1.0.0-rc.27",
    "knex": "^0.17.6",
    "koa": "^2.7.0",
    "koa-bodyparser": "^4.2.1",
    "koa-passport": "^4.1.3",
    "koa-router": "^7.4.0",
    "koa-session": "^5.12.0",
    "moment": "^2.24.0",
    "neo4j-driver": "^1.7.5",
    "neo4j-graphql-js": "^2.5.0",
    "parse-neo4j": "^0.6.11",
    "passport": "^0.4.0",
    "passport-local": "^1.0.0",
    "path": "^0.12.7",
    "pg": "^7.11.0",
    "ts-node": "^8.2.0",
    "tsconfig-paths": "^3.8.0",
    "winston": "^3.2.1"
  }
}
{
    "watch": ["./src"],
    "ext": "ts",
    "exec": "ts-node -r tsconfig-paths/register ./src/server.ts",
    "ignore": ["database/migrations/*"] 
   }
package.json

{
    "compileOnSave": false,
    "compilerOptions": {
      "paths": { "*": ["types/*"] },
      "noImplicitAny": false,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "moduleResolution" : "node",
      "lib": [
        "es2018"
      ],
      "types": [
        "node"
      ],
      "sourceMap": true,
      "baseUrl": "./src"
    },
    "exclude": [
      "node_modules",
      "**/*.spec.ts"
    ]
  }
{
  "name": "graphql-api",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "test": "cross-env NODE_PATH=./src mocha --timeout 25000 --exit -r ts-node/register ./test/**/*.test.ts",
    "start": "nodemon"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "nodemon": "^1.19.1",
    "typescript": "^3.5.1",
    "chai": "^4.2.0",
    "chai-http": "^4.3.0",
    "mocha": "^6.1.4"
  },
  "dependencies": {
    "@babel/runtime": "^7.4.5",
    "@types/mocha": "^5.2.7",
    "@types/neo4j": "^2.0.2",
    "apollo-server": "^2.6.2",
    "apollo-server-koa": "^2.6.3",
    "babel-plugin-transform-runtime": "^6.23.0",
    "bcryptjs": "^2.4.3",
    "dotenv": "^8.0.0",
    "fs": "0.0.1-security",
    "graphql": "^14.3.1",
    "graphql-voyager": "^1.0.0-rc.27",
    "knex": "^0.17.6",
    "koa": "^2.7.0",
    "koa-bodyparser": "^4.2.1",
    "koa-passport": "^4.1.3",
    "koa-router": "^7.4.0",
    "koa-session": "^5.12.0",
    "moment": "^2.24.0",
    "neo4j-driver": "^1.7.5",
    "neo4j-graphql-js": "^2.5.0",
    "parse-neo4j": "^0.6.11",
    "passport": "^0.4.0",
    "passport-local": "^1.0.0",
    "path": "^0.12.7",
    "pg": "^7.11.0",
    "ts-node": "^8.2.0",
    "tsconfig-paths": "^3.8.0",
    "winston": "^3.2.1"
  }
}
{
    "watch": ["./src"],
    "ext": "ts",
    "exec": "ts-node -r tsconfig-paths/register ./src/server.ts",
    "ignore": ["database/migrations/*"] 
   }
nodemon.json

{
    "compileOnSave": false,
    "compilerOptions": {
      "paths": { "*": ["types/*"] },
      "noImplicitAny": false,
      "emitDecoratorMetadata": true,
      "experimentalDecorators": true,
      "moduleResolution" : "node",
      "lib": [
        "es2018"
      ],
      "types": [
        "node"
      ],
      "sourceMap": true,
      "baseUrl": "./src"
    },
    "exclude": [
      "node_modules",
      "**/*.spec.ts"
    ]
  }
{
  "name": "graphql-api",
  "version": "1.0.0",
  "description": "",
  "main": "app.js",
  "scripts": {
    "test": "cross-env NODE_PATH=./src mocha --timeout 25000 --exit -r ts-node/register ./test/**/*.test.ts",
    "start": "nodemon"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "nodemon": "^1.19.1",
    "typescript": "^3.5.1",
    "chai": "^4.2.0",
    "chai-http": "^4.3.0",
    "mocha": "^6.1.4"
  },
  "dependencies": {
    "@babel/runtime": "^7.4.5",
    "@types/mocha": "^5.2.7",
    "@types/neo4j": "^2.0.2",
    "apollo-server": "^2.6.2",
    "apollo-server-koa": "^2.6.3",
    "babel-plugin-transform-runtime": "^6.23.0",
    "bcryptjs": "^2.4.3",
    "dotenv": "^8.0.0",
    "fs": "0.0.1-security",
    "graphql": "^14.3.1",
    "graphql-voyager": "^1.0.0-rc.27",
    "knex": "^0.17.6",
    "koa": "^2.7.0",
    "koa-bodyparser": "^4.2.1",
    "koa-passport": "^4.1.3",
    "koa-router": "^7.4.0",
    "koa-session": "^5.12.0",
    "moment": "^2.24.0",
    "neo4j-driver": "^1.7.5",
    "neo4j-graphql-js": "^2.5.0",
    "parse-neo4j": "^0.6.11",
    "passport": "^0.4.0",
    "passport-local": "^1.0.0",
    "path": "^0.12.7",
    "pg": "^7.11.0",
    "ts-node": "^8.2.0",
    "tsconfig-paths": "^3.8.0",
    "winston": "^3.2.1"
  }
}
{
    "watch": ["./src"],
    "ext": "ts",
    "exec": "ts-node -r tsconfig-paths/register ./src/server.ts",
    "ignore": ["database/migrations/*"] 
   }

你能把它整理一下吗?我猜案例节点_ENV=production的一些配置,对吗?无论如何,如果你能在这里分享你的解决方案,那就太好了。谢谢你能把它整理一下吗?我猜案例节点_ENV=production的一些配置,对吗?无论如何,如果你能在这里分享你的解决方案,那就太好了。谢谢