简体   繁体   English

将Angular 2(quickstart应用)部署到Google Cloud平台

[英]Deploying Angular 2 (quickstart app) to Google Cloud platform

I was trying to deploy the simplest project on Google Cloud platform. 我试图在Google Cloud平台上部署最简单的项目。 The quickstart project can be found here . 快速启动项目可以在这里找到。 Locally it works without issues. 在本地它没有问题。

However it gets more complicated to get it working on Google Cloud. 但是,使其在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. 我知道还有很多其他提供商,例如具有一键式部署的Heroku,但我发现使用Google服务并非易事,这很奇怪。

App.yaml 应用程式

runtime: nodejs
env: flex

Package.json - as provided in quickstart project here Package.json-在此处的快速入门项目中提供

The first error I get while deploying (gclould app deploy): 我在部署(gclould应用程序部署)时遇到的第一个错误:

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

Then I add to package.json: 然后我添加到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. 当然,我在使用支持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/ 如果我以正确的方式解决问题的任何想法,或者只应该使用在codelabs.developers.google.com/codelabs/cloud-cardboard-viewer/上找到的简单教程来重新创建我的项目

You can use the flex environment if you have any server side code eg you have written specific server logic to CURD objects. 如果您有任何服务器端代码,则可以使用flex环境,例如,已将特定的服务器逻辑写入CURD对象。 For client side code you will be better off deploying static files into google storage 对于客户端代码,最好将静态文件部署到Google存储中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将 Rails 6 应用程序部署到 Google Cloud Platform App Engine 时出错 - Error while deploying Rails 6 app to Google Cloud Platform App Engine 在Google Cloud上部署Angular2应用时出错 - Error deploying Angular2 app on Google Cloud 在Google Cloud Platform上部署Flask应用时出错 - Error while deploying Flask app on Google Cloud Platform 在Google Cloud Platform上部署mongodb? - deploying mongodb on google cloud platform? 将 Django 部署到谷歌云平台 - Deploying Django to Google cloud platform 将静态 React JS 应用程序部署到 Google Cloud Platform (GCP)? - Deploying a static React JS app to Google Cloud Platform (GCP)? 在 Google Cloud App Engine 上部署 Angular 通用应用程序时出错 - Error when deploying Angular Universal app on Google Cloud App Engine 在Google的云平台上部署多个应用程序, - deploying several Apps on Google's Cloud Platform, 将create-react-app构建部署到Google Cloud Platform后找不到URL - URLs not found after deploying create-react-app build to Google Cloud Platform 为什么Google Cloud Storage quickstart.py可以在Google Cloud Shell上运行而不在Google App Engine上运行? - Why Google Cloud Storage quickstart.py works on google cloud shell but not on Google App Engine?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM