Deploy ng-2 admin Angular 2 to heroku

会有一股神秘感。 提交于 2019-12-06 18:50:26

i solve the problem,

  1. delete /dist from .gitignore
  2. run the project localy in production with npm run build:prod to generate a /dist folder
  3. modify package.json file by adding

    "engines": { "node": "6.9.1", "npm": "3.10.8" } and
    "start": "http-server dist/",
    "preinstall": "npm install -g http-server" in scripts

have you tried adding the following line to the scripts section?

"postinstall": "ng build --aot -prod"

I think that you also need to move:

"@angular/cli": "1.0.4",
"@angular/compiler-cli": "4.1.3",

to the dependencies section for this to work.

Hope it helps.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!