How do I deploy Node_Modules on Google App Engine Flexible

321 views
Skip to first unread message

Dos Branding

unread,
Jan 11, 2019, 12:17:52 PM1/11/19
to Google App Engine
After deploying my files, my node_modules folder is not being deployed. How do I enable it to work.

I am running on PHP Flexible.

George (Cloud Platform Support)

unread,
Jan 11, 2019, 3:02:47 PM1/11/19
to Google App Engine
Hello Dos, 

How did you deploy your app? What commands did you run? As a first step, you may consider running 'gcloud components update', and then try deploying again. 

If you run gcloud app deploy, what directory were you in? If you deploy again with gcloud app deploy --verbosity=debug, what is the output from this command? 

You may have a look at the Quickstart page for reference. 

What is the output of gcloud info? 

Dos Branding

unread,
Jan 14, 2019, 1:22:34 PM1/14/19
to google-a...@googlegroups.com
After running gcloud app deploy --verbosity=debug this is what I got.
Result: {
   
"response": {
       
"betaSettings": {
           
"has_docker_image": "true",
           
"module_yaml_path": "app.yaml",
           
"no_appserver_affinity": "true",
           
"use_deployment_manager": "true"
       
},
       
"versionUrl": "https://[REDACTED].appspot.com",
       
"livenessCheck": {
           
"successThreshold": 2,
           
"timeout": "4s",
           
"initialDelay": "300s",
           
"checkInterval": "30s",
           
"failureThreshold": 4
       
},
       
"name": "apps/[REDACTED]/services/[REDACTED]/versions/[REDACTED]",
       
"runtimeApiVersion": "1.0",
       
"servingStatus": "SERVING",
       
"createTime": "2019-01-14T18:12:26Z",
       
"@type": "type.googleapis.com/google.appengine.v1.Version",
       
"env": "flexible",
       
"automaticScaling": {
           
"maxTotalInstances": 20,
           
"minTotalInstances": 2,
           
"cpuUtilization": {
               
"targetUtilization": 0.5
           
},
           
"coolDownPeriod": "120s"
       
},
       
"runtime": "php",
       
"id": "[REDACTED]",
       
"readinessCheck": {
           
"successThreshold": 2,
           
"appStartTimeout": "300s",
           
"timeout": "4s",
           
"checkInterval": "5s",
           
"failureThreshold": 2
       
},
       
"threadsafe": true
   
},
   
"done": true,
   
"name": "apps/[REDACTED]/operations/c029133f-04bb-4207-97f9-2156f77e6eb0",
   
"metadata": {
       
"target": "apps/[REDACTED]/services/[REDACTED]/versions/[REDACTED]",
       
"method": "google.appengine.v1.Versions.CreateVersion",
       
"user": "[REDACTED]",
       
"insertTime": "2019-01-14T18:12:23.628Z",
       
"endTime": "2019-01-14T18:20:24.557Z",
       
"@type": "type.googleapis.com/google.appengine.v1.OperationMetadataV1"
   
}
}
Updating service [[REDACTED]] (this may take several minutes)...done.
DEBUG
: Operation [apps/[REDACTED]/operations/3384f64f-d388-4fa7-a826-a46dcb9c3179] not complete. Waiting to retry.
Setting traffic split for service [[REDACTED]]...⠛DEBUG: Operation [apps/[REDACTED]/operations/3384f64f-d388-4fa7-a826-a46dcb9c3179] not complete. Waiting to retry.
Setting traffic split for service [[REDACTED]]...⠹DEBUG: Operation [apps/[REDACTED]/operations/3384f64f-d388-4fa7-a826-a46dcb9c3179] complete. Result: {
   
"response": {
       
"split": {
           
"allocations": {
               
"[REDACTED]": 1
           
}
       
},
       
"@type": "type.googleapis.com/google.appengine.v1.Service",
       
"name": "apps/[REDACTED]/services/[REDACTED]",
       
"id": "default"
   
},
   
"done": true,
   
"name": "apps/[REDACTED]/operations/3384f64f-d388-4fa7-a826-a46dcb9c3179",
   
"metadata": {
       
"target": "apps/[REDACTED]/services/default",
       
"method": "google.appengine.v1.Services.UpdateService",
       
"user": "[REDACTED]",
       
"insertTime": "2019-01-14T18:20:28.271Z",
       
"endTime": "2019-01-14T18:20:29.593Z",
       
"@type": "type.googleapis.com/google.appengine.v1.OperationMetadataV1"
   
}
}
Setting traffic spEnter code here...









Output of gcloud info is  
Google Cloud SDK [229.0.0]

Platform: [Mac OS X, x86_64] ('Darwin', '[REDACTED]', '17.7.0', 'Darwin Kernel Version 17.7.0: Fri Nov  2 20:43:16 PDT 2018; root:xnu-4570.71.17~1/RELEASE_X86_64', 'x86_64', 'i386')
Python Version: [2.7.15 (default, Jan 12 2019, 21:43:48)  [GCC 4.2.1 Compatible Apple LLVM 10.0.0 (clang-1000.11.45.5)]]
Python Location: [/usr/local/Cellar/python@2/2.7.15_2/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python]
Site Packages: [Disabled]

Installation Root: [/Users/[REDACTED]/Documents/google-cloud-sdk]
Installed Components:
  core
: [2019.01.04]
  gsutil
: [4.35]
  bq
: [2.0.39]
  alpha
: [2018.11.09]
System PATH: [/usr/local/Cellar/python/3.7.2/bin:/usr/local/Cellar/openssl/1.0.2o/bin:/Users/[REDACTED]/Documents/google-cloud-sdk/bin:/Applications/MAMP/bin/php/php7.2.10/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]
Python PATH: [/Users/[REDACTED]/Documents/google-cloud-sdk/lib/third_party:/Users/[REDACTED]/Documents/google-cloud-sdk/lib:/usr/local/Cellar/python@2/2.7.15_2/Frameworks/Python.framework/Versions/2.7/lib/python27.zip:/usr/local/Cellar/python@2/2.7.15_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7:/usr/local/Cellar/python@2/2.7.15_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin:/usr/local/Cellar/python@2/2.7.15_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac:/usr/local/Cellar/python@2/2.7.15_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages:/usr/local/Cellar/python@2/2.7.15_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk:/usr/local/Cellar/python@2/2.7.15_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old:/usr/local/Cellar/python@2/2.7.15_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload]
Cloud SDK on PATH: [True]
Kubectl on PATH: [False]

Installation Properties: [/Users/[REDACTED]/Documents/google-cloud-sdk/properties]
User Config Directory: [/Users/[REDACTED]/.config/gcloud]
Active Configuration Name: [default]
Active Configuration Path: [/Users/[REDACTED]/.config/gcloud/configurations/config_default]

Account: [[REDACTED]]
Project: [[REDACTED]]

Current Properties:
 
[core]
    project
: [[REDACTED]]
    account
: [[REDACTED]]
    disable_usage_reporting
: [False]
 
[compute]
    region
: [us-east4]
    zone
: [us-east4-c]

Logs Directory: [/Users/[REDACTED]/.config/gcloud/logs]
Last Log File: [/Users/[REDACTED]/.config/gcloud/logs/2019.01.14/13.11.11.125328.log]

git
: [git version 2.14.1]
ssh
: [OpenSSH_7.8p1, LibreSSL 2.6.2]Enter code here...


Dos Branding

unread,
Jan 17, 2019, 6:18:51 PM1/17/19
to Google App Engine
Hi George, please review the results I posted below and let me know the error I am facing.

Tiago (Google Cloud Platform Support)

unread,
Jan 21, 2019, 3:54:39 PM1/21/19
to Google App Engine
Hi,

When using the flex environment, by default, the `node_modules` folder is added to your (hidden) .gcloudignore file and is not uploaded as part of your deployment. To deploy pre-installed dependencies, make sure to remove `node_modules/` from the `.gcloudifnore` file before deploying your application.

We should also apologize for not asking you to send us the REDACTED info by using the `--anonymize` flag. So, I have edited your previous post and removed the sensitive info out of your post.  

Dos Branding

unread,
Jan 21, 2019, 8:43:34 PM1/21/19
to google-a...@googlegroups.com
It worked.

I added a .gcloudignore file and in the file added
!node_modules.

Tiago (Google Cloud Platform Support)

unread,
Jan 28, 2019, 1:33:36 PM1/28/19
to google-a...@googlegroups.com
Happy to hear that! Thank you for sharing the steps you've performed to resolve this issue.
Reply all
Reply to author
Forward
0 new messages