mys*_*dad 7 node.js npm google-cloud-storage google-cloud-platform google-apis-explorer
Module not found: Can't resolve 'fs'尝试从 GCP Storage 列出存储桶时出现错误。
import { Storage } from '@google-cloud/storage';
const googleCloud = new Storage({
keyFilename: '../../my-project-c1a44bf80be3.json',
projectId: 'my-project',
});
googleCloud.getBuckets().then((x: any) => console.log(x));
Run Code Online (Sandbox Code Playgroud)
my-project-c1a44bf80be3.json(从GCP下载)存在并且是项目级别
错误:
event - compiled successfully
event - build page: /
wait - compiling...
error - ./node_modules/@google-cloud/storage/build/src/file.js:24:0
Module not found: Can't resolve 'fs'
null
Could not find files for / in .next/build-manifest.json
event - compiled successfully
Run Code Online (Sandbox Code Playgroud)
使用googleapis时会出现相同的错误。但是,./node_modules/@google-cloud/storage/build/src/file.js:24:0它不是google-auth-library在googleapis.
添加使用yarn.
当您在客户端导入或引用 firebase-admin 时,通常会发生这种情况,请检查您的代码是否有可能调用的错误导入
import * as firebase from "firebase-admin";
Run Code Online (Sandbox Code Playgroud)
代替
import firebase from "firebase";
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
8321 次 |
| 最近记录: |