Heroku上的Angular4,不兼容buildpack

时间:2017-08-26 23:29:15

标签: angular heroku

按照本教程,在Herouku上托管Angular:https://medium.com/@ervib/deploy-angular-4-app-with-express-to-heroku-6113146915ca

我在尝试推送Heroku时遇到错误。看了几个有类似问题的帖子,没什么用。

错误讯息:

$ git push heroku master
Counting objects: 40, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (36/36), done.
Writing objects: 100% (40/40), 73.70 KiB | 0 bytes/s, done.
Total 40 (delta 1), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> App not compatible with buildpack: https://github.com/heroku/heroku-buildpack-nodejs#v83
remote:        More info: https://devcenter.heroku.com/articles/buildpacks#detection-failure
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !   Push rejected to XXXXXXXXXXXX.
remote:
To https://git.heroku.com/XXXXXXXXXXXX.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/XXXXXXXXXXXX.git'

这是我的文件结构,文件夹的根目录:

enter image description here

的package.json

{
  "name": "webapp",
  "version": "0.0.0",
  "license": "MIT",
  "main": "app.js",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "postinstall": "grunt ng build --aot -prod"
  },
  "engines": {
    "node": "~6.10.3",
    "npm": "~3.10.5"
  },
  "private": true,
  "dependencies": {
    "@angular/cli": "1.0.3",
    "@angular/animations": "^4.2.4",
    "@angular/compiler-cli": "^4.0.0",
    "@angular/common": "^4.2.4",
    "@angular/compiler": "^4.2.4",
    "@angular/core": "^4.2.4",
    "@angular/forms": "^4.2.4",
    "@angular/http": "^4.2.4",
    "@angular/platform-browser": "^4.2.4",
    "@angular/platform-browser-dynamic": "^4.2.4",
    "@angular/router": "^4.2.4",
    "core-js": "^2.4.1",
    "rxjs": "^5.4.2",
    "zone.js": "^0.8.14"
  },
  "devDependencies": {
    "@angular/cli": "1.3.2",
    "@angular/compiler-cli": "^4.2.4",
    "@angular/language-service": "^4.2.4",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "~3.1.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~3.2.0",
    "tslint": "~5.3.2",
    "typescript": "~2.3.3"
  }
}

0 个答案:

没有答案