Closed richardmoore725 closed 11 months ago
Does stream module have PipelineSource type?
@richardmoore725 I assume this is with version 7.4.0
? What Node version are you using?
Does adding types:['node']
to your tsconfig resolve the issue?
node 18.18.0 "@google-cloud/storage": "^7.4.0",
yes, I have added "compilerOptions": { "target": "es6", "module": "commonjs", "outDir": "dist/", "sourceMap": true, "types":["node"] }
Can you provide me with the full tsconfig and maybe a code snippet or are you running the sample directly?
I was going to copy a file on my bucket to localhost. await new Storage() .bucket(bucketName) .file(fileName) .createReadStream() .pipe(fs.createWriteStream(destFileName))
{ "compilerOptions": { "target": "es6", "module": "commonjs", "outDir": "dist/", "sourceMap": true, "types":["node"] }, "files": [ "./node_modules/@types/mocha/index.d.ts", "./node_modules/@types/node/index.d.ts", "./node_modules/@types/express/index.d.ts", "./node_modules/@types/dotenv/index.d.ts", "./node_modules/@types/express-session/index.d.ts", "./src/types/express-validator.d.ts" ], "include": [ "src/*/.ts" ], "exclude": [ "typings/*", "node_modules" ] }
for package.json :
"scripts": { "build": "npm run tsc", "tsc": "tsc -p tsconfig.json",
I have tried "yarn build"
Not sure if this is the issue or not but you shouldn't need to add anything under @types
to the tsconfig
I believe they are included automatically.
I would also check that your @types/node
is updated to a recent version.
@richardmoore725 were you able to resolve this issue?
Hi,
I had the same issue. For me i had package:
"@types/node": "^14.11.2"
Upgraded to the version
"@types/node": "^20.9.0"
And this resolved the issue for me.
Thanks @PowerKrautInternet for confirming. I'm going to close this issue as it seems updating @types/node
resolves this problem.
When I try to run /samples/streamFileDownload.js, I meet compile error.
node_modules/@google-cloud/storage/build/cjs/src/file.d.ts:7:30 - error TS2305: Module '"stream"' has no exported member 'PipelineSource'.
7 import { Writable, Readable, PipelineSource } from 'stream';