Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

289
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!