Deploying Angular 2 (quickstart app) to Google Cloud platform

陌路散爱 提交于 2019-12-02 11:42:09

问题


I was trying to deploy the simplest project on Google Cloud platform. The quickstart project can be found here. Locally it works without issues.

However it gets more complicated to get it working on Google Cloud. I know there are a lot of other providers like Heroku with 1-click deployment, but I found it weird that it's not so easy to do it with Google service.

App.yaml

runtime: nodejs
env: flex

Package.json - as provided in quickstart project here

The first error I get while deploying (gclould app deploy):

angular-quickstart@1.0.0 start /app
tsc && concurrently "tsc -w" "lite-server"
sh: 1: tsc: not found

Then I add to package.json:

"preinstall": "npm install tsc",

The second error:

tsc && concurrently "tsc -w" "lite-server"
error TS5023: Unknown compiler option 'moduleResolution'.
error TS5023: Unknown compiler option 'lib'.

Here I am lost.

Of course I'm using location that supports flex.

Any ideas if I'm digging the problem in right way or I should just recreate my project using simple tutorial found at codelabs.developers.google.com/codelabs/cloud-cardboard-viewer/


回答1:


You can use the flex environment if you have any server side code e.g you have written specific server logic to CURD objects. For client side code you will be better off deploying static files into google storage



来源:https://stackoverflow.com/questions/41482649/deploying-angular-2-quickstart-app-to-google-cloud-platform

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