When I run gcloud app deploy I get error response 9. The error message I get is
Updating service [default] (this may take several minutes)...failed.
ERROR: (gcloud.app.deploy) Error Response: [9]
Application startup error:
app.js
// Imports the Google Cloud client library
const Datastore = require('@google-cloud/datastore');
// Your Google Cloud Platform project ID
const projectId = 'myid';
// Creates a client
const datastore = new Datastore({
projectId: projectId,
});
// The kind for the new entity
const kind = 'Task';
// The name/ID for the new entity
const name = 'sampletask1';
// The Cloud Datastore key for the new entity
const taskKey = datastore.key([kind, name]);
// Prepares the new entity
const task = {
key: taskKey,
data: {
description: 'Buy milk',
},
};
// Saves the entity
datastore
.save(task)
.then(() => {
console.log(`Saved ${task.key.name}: ${task.data.description}`);
})
.catch(err => {
console.error('ERROR:', err);
});
package.json
{
"name": "first-application",
"version": "1.0.0",
"description": "First program using cloud datastore",
"main": "app.js",
"scripts": {
"start":"node app.js",
"deploy":"gcloud app deploy",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Ragav",
"license": "ISC",
"dependencies": {
"@google-cloud/datastore": "^1.4.1"
}
}
app.yaml
runtime: nodejs
vm: true
Please help me, I am trying to learn deploying my app server on GCP. Appreciate your help.
Thanks!