简体   繁体   中英

Getting Error while deploying angular 2 app on heroku

I am facing sh: 1: tsc: not found Error while deploying angular 2 app on heroku and I am using node version : v7.2.0 npm Version:v4.0.3.

Image of the error on heroku

Can any one tell me,How can i fix this issue ?

The issue is in the process in which Heroku installs and removes dev-dependencies. When you push to Heroku it installs dev-dependencies, runs your build script then removes dev-dependencies.

My issue was that I had a "prestart" script that relied on the dev-dependencies. This essentially made the build script run again but since by this time the dev-dependencies are gone, I got the "not found" errors on tsc and other modules.

I removed the "prestart" script and now all is well.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM