question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to deploy Angular 4 web application to Google Cloud Platform?

See original GitHub issue

Bug Report or Feature Request (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] question

Versions.

@angular/cli: 1.0.2 node: 6.9.2 os: linux x64 @angular/common: 4.1.3 @angular/compiler: 4.1.3 @angular/core: 4.1.3 @angular/forms: 4.1.3 @angular/http: 4.1.3 @angular/platform-browser: 4.1.3 @angular/platform-browser-dynamic: 4.1.3 @angular/router: 4.1.3 @angular/cli: 1.0.2 @angular/compiler-cli: 4.1.3

Repro steps.

I followed the steps in this article Build a web app using Google Cloud Platform, but I met some problems when I ran this command to deploy the web app.

gcloud app deploy --version v1

The error shows ‘ng not found’. How can I deal with it? Should I change the npm start command? Or build my own docker file and push to Google Cloud? I have node and npm installed(both meet requirement), as well as angular/cli.

The log given by the failure.

Updating service [default]...failed.                                                                                                                            
ERROR: (gcloud.app.deploy) Error Response: [9] 
Application startup error:
> loklak-message-publisher@0.0.0 start /app
> ng serve
sh: 1: ng: not found
npm ERR! Linux 3.16.0-4-amd64
npm ERR! argv "/nodejs/bin/node" "/nodejs/bin/npm" "start"
npm ERR! node v6.10.3
npm ERR! npm  v3.10.10
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! loklak-message-publisher@0.0.0 start: `ng serve`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the loklak-message-publisher@0.0.0 start script 'ng serve'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the loklak-message-publisher package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ng serve
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs loklak-message-publisher
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls loklak-message-publisher
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR!     /app/npm-debug.log

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10

github_iconTop GitHub Comments

2reactions
egarsoncommented, Mar 10, 2018

Docker is awesome. If you don’t happen to be using Docker, this link provides one deployment solution to vanilla App Engine, and although slightly dated, I have used it successfully with Angular 5.1.6. Interestingly, it uses the Python runtime. HTH

0reactions
angular-automatic-lock-bot[bot]commented, Sep 8, 2019

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

Read more comments on GitHub >

github_iconTop Results From Across the Web

App Engine deployment with Angular, Nginx, Docker, and ...
This tutorial shows you how to deploy a sample Angular application to App Engine using the gcloud command-line tool.
Read more >
How to Deploy Angular Application on Google Cloud Run
Use image from NodeJS - version 17- minimal version; Install the Angular CLI; Expose the port 4200 as in our index.js file; Run...
Read more >
How To Deploy an Angular App on Google Cloud
Go to your Google Cloud console and be sure you have opened the project where Cloud Run has your service in it. Go...
Read more >
How to Deploy Angular 8 App to Google App Engine - Digizoo
Cloud Build Options · In the build environment, install all the NPM dependencies defined in the package.json · Using the Angular Cloud Builder...
Read more >
Setup and Deploy Angular app to Google Cloud Run
First thing you need to do is go to the Google Cloud Console and create a Cloud Run service. When on the Cloud...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found