Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

282
Vistas
How to fix Api Error: Required parameter: project in GAE with GCS

I am getting the following error when trying to connect with a Google Cloud Storage Bucket in a nodejs app based in the Google App Engine.

ApiError: Required parameter: project

   at Util.parseHttpRespBody (/workspace/node_modules/@google-cloud/common/build/src/util.js:208:38)

   at Util.handleResp (/workspace/node_modules/@google-cloud/common/build/src/util.js:149:117)

The code to connect in the server.js file is pretty straightforward:

const {Storage} = require('@google-cloud/storage');
const storage = new Storage();
storage.getBuckets().then(y => console.log(y));

Both the deployed app and storage bucket are part of the same project.

I have also created a service account for the storage bucket, which has API Keys Admin and Storage Admin roles, and API keys have been generated.

Any help would be much appreciated!

Edit:

Here is the updated code (with my project id edited):

const {Storage} = require('@google-cloud/storage');

const storage = new Storage({
  projectId: 'r@@@@@@t-t@@@h-3####9'
});

storage.getBuckets().then(y => console.log(y));

package.json dependencies:

"dependencies": {
    "@google-cloud/storage": "^5.15.3",
    "body-parser": "^1.19.0",
    "dotenv": "^10.0.0",
    "ejs": "^3.1.6",
    "express": "^4.17.1",
    "multer": "^1.4.3",
    "pg": "^8.7.1",
    "pg-hstore": "^2.3.4",
    "sequelize": "^6.6.5",
    "sequelize-cli": "^6.2.0"
  },
  "devDependencies": {
    "@types/node": "^14.6.2",
    "nodemon": "^2.0.14"
  }
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Create the client and specify the Project ID (not the project name):

const storage = new Storage({
  projectId: 'your-project-id'
});

If you want to specify the service account that you mentioned:

const storage = new Storage({
  projectId: 'your-project-id',
  keyFilename: '/path/to/service-account-key.json'
});

Documentation:

Google Cloud Storage Nodejs Client

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda