创建cloud storage的bucket时报错:
ApiError: The combination of locationConstraint and storageClass you provided is not supported for your project
原因是location参数设置错误,错误的代码:
async function main() {
const buckets = await getBuckets();
logger.info(JSON.stringify(buckets));
const bucketName = 'nodejs-gcp';
await createBucket(bucketName, {
regional: true,
location: 'ASIA'
});
}
修改后的代码:
async function main() {
const buckets = await getBuckets();
logger.info(JSON.stringify(buckets));
const bucketName = 'nodejs-gcp';
await createBucket(bucketName, {
regional: true,
location: 'asia-east1'
});
}
去GCP控制台查看:

nodejs的客户端代码的location设置的是上图中红线区域中的值。
创建
cloud storage的bucket时报错:原因是
location参数设置错误,错误的代码:修改后的代码:
去
GCP控制台查看:nodejs的客户端代码的location设置的是上图中红线区域中的值。