googleapis / nodejs-storage

Node.js client for Google Cloud Storage: unified object storage for developers and enterprises, from live data serving to data analytics/ML to data archiving.
https://cloud.google.com/storage/
Apache License 2.0
888 stars 368 forks source link

node_modules/@google-cloud/storage/build/cjs/src/file.d.ts:7:30 - Module '"stream"' has no exported member 'PipelineSource'. #2394

Closed manuelquezada23 closed 5 months ago

manuelquezada23 commented 5 months ago

I am getting this error from @google-cloud/storage when using the firebase and firebase-admin modules. Any ideas what is going on?

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';
                               ~~~~~~~~~~~~~~
Found 1 error in node_modules/@google-cloud/storage/build/cjs/src/file.d.ts:7

I am using Typescript. This is my package.json:

{
  "name": "anonymous",
  "version": "1.0.0",
  "description": "",
  "author": "Anonymous",
  "main": "src/app.ts",
  "scripts": {
    "dev": "nodemon src/app.ts",
    "test": "jest --runInBand",
    "nodetest": "jest --runInBand Nodes",
    "anchortest": "jest --runInBand Anchors",
    "linktest": "jest --runInBand Links",
    "labtest": "jest --runInBand insertNode && jest --runInBand createNode",
    "lint": "prettier --check . && eslint .",
    "format": "prettier --write . && eslint . --fix",
    "coverage": "jest --coverage",
    "build": "tsc",
    "prod": "node dist/src/app.js"
  },
  "license": "MIT",
  "dependencies": {
    "@babel/cli": "^7.14.5",
    "@babel/core": "^7.14.6",
    "@babel/node": "^7.14.7",
    "@babel/preset-env": "^7.14.7",
    "@google-cloud/storage": "^7.7.0",
    "@shelf/jest-mongodb": "^2.0.3",
    "@typescript-eslint/eslint-plugin": "^6.0.0",
    "@typescript-eslint/parser": "^6.0.0",
    "bcrypt": "^5.1.1",
    "body-parser": "^1.19.0",
    "cors": "^2.8.5",
    "dotenv": "^10.0.0",
    "eslint": "^7.32.0",
    "eslint-config-google": "^0.14.0",
    "eslint-plugin-react": "^7.25.1",
    "express": "^4.18.2",
    "firebase": "^10.7.1",
    "firebase-admin": "^12.0.0",
    "jest": "^27.0.6",
    "jest-audio-reporter": "^2.2.1",
    "jsonwebtoken": "^9.0.2",
    "mock-mongo": "^1.1.3",
    "moment": "^2.29.4",
    "mongo-mock": "^4.1.0",
    "mongodb": "^3.7.4",
    "mongodb-memory-server": "^7.3.6",
    "next-auth": "^4.24.5",
    "node-fetch": "^2.7.0",
    "nodemon": "^3.0.1",
    "prettier": "2.3.2",
    "sendmail": "^1.6.1",
    "socket.io": "^4.7.2",
    "stream": "^0.0.2",
    "ts-jest": "^27.0.5",
    "ts-node": "^10.2.1",
    "typescript": "^4.4.3",
    "uniqid": "^5.4.0",
    "uuid": "^9.0.1",
    "webpack-hot-middleware": "^2.25.0"
  },
  "repository": {
    "type": "git",
    "url": "anonymous"
  },
  "keywords": [],
  "bugs": {
    "url": "anonymous"
  },
  "homepage": "anonymous",
  "prettier": {},
  "devDependencies": {
    "@types/body-parser": "^1.19.0",
    "@types/cors": "^2.8.12",
    "@types/express": "^4.17.12",
    "@types/jest": "^27.0.1",
    "@types/lodash": "^4.14.171",
    "@types/mongodb": "^3.5.27",
    "@types/node": "^13.13.52",
    "@types/uniqid": "^5.3.2"
  },
  "overrides": {
    "@types/mongodb": {
      "@types/bson": "4.0.5"
    }
  }
}
ddelgrosso1 commented 5 months ago

Hi @manuelquezada23 please update @types/node. That should resolve the issue for you.

manuelquezada23 commented 5 months ago

Hi @ddelgrosso1, unfortunately after running npm update @types/node, I am still seeing the same message. I see the error message when running npm ci; npm run build. If it helps, this is my tsconfig.json:

{
  "compilerOptions": {
    "outDir": "./dist/",
    "noImplicitAny": false,
    "sourceMap": true,
    "module": "commonjs",
    "esModuleInterop": true,
    "resolveJsonModule": true,
    "allowSyntheticDefaultImports": true,
    "target": "ES2017",
    "jsx": "react",
    "allowJs": true,
    "moduleResolution": "node",
    "experimentalDecorators": true,
    "useDefineForClassFields": true
  }
}
ddelgrosso1 commented 5 months ago

@manuelquezada23 what version of @types/node did you update to?

manuelquezada23 commented 5 months ago

I am using ^13.13.52. It shows up under devDependencies in my package.json:

  ...
  "devDependencies": {
    "@types/body-parser": "^1.19.0",
    "@types/cors": "^2.8.12",
    "@types/express": "^4.17.12",
    "@types/jest": "^27.0.1",
    "@types/lodash": "^4.14.171",
    "@types/mongodb": "^3.5.27",
    "@types/node": "^13.13.52",
    "@types/uniqid": "^5.3.2"
  },
 ...
manuelquezada23 commented 5 months ago

I was able to fix it by updating it to ^20.11.0. Thank you!