[英]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.