microsoft / TypeScript-Node-Starter

A reference example for TypeScript and Node with a detailed README describing how to use the two together.
MIT License
11.31k stars 2.77k forks source link

Deploy on Azure Web Apps #36

Closed michaellperry closed 6 years ago

michaellperry commented 7 years ago

When I try to deploy this starter on Azure Web Apps, I get the following error on deployment:

Invalid start-up command "npm run build && npm run watch" in package.json. Please use the format "node <script relative path>".
Looking for app.js/server.js under site root.
Missing server.js/app.js files, web.config is not generated

What's the best way to do this?

GavinPacini commented 7 years ago

Could you try change the start script in package.json to node dist/server.js. This will require you have run it once locally.

Not the most elegant solution, will reply again if I think of something better.

lzl124631x commented 6 years ago

@michaellperry Is your problem solved? I met the same issue. remote: Invalid start-up command "npm run build && node app.js" in package.json. Please use the format "node <script relative path>". https://github.com/projectkudu/kudu/issues/2756 @GavinPacini I have to npm run build first to transpile the code then node app.js. It's too weak if azure only supports node <script>.

michaellperry commented 6 years ago

I solved the problem by changing the build to use Gulp. It has diverged quite a bit from this template.