firebase-admin 5.12.0 fails to compile with tsc
[READ] Step 1: Are you in the right place?
- For issues or feature requests related to the code in this repository file a Github issue.
[REQUIRED] Step 2: Describe your environment
- Operating System version: OSX 10.11.3
- Firebase SDK version: 5.12.0
- Library version: _____
- Firebase Product: firebase-admin for node.js (auth, database, storage, etc)
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
What happened? How can we make the problem occur?
I'm using typescript environment to code the server on Node.js When I compile the code, it's returning with an error:
> rimraf dist && tsc --outDir dist
node_modules/firebase-admin/lib/index.d.ts(18,22): error TS7016: Could not find a declaration file for module '@google-cloud/storage'. '/<path-to-project>/node_modules/@google-cloud/storage/src/index.js' implicitly has an 'any' type.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
I have the upgraded firebase-admin to the latest version (5.12.0)
"firebase-admin": "^5.12.0",
Hey there! I couldn't figure out what this issue is about, so I've labeled it for a human to triage. Hang tight.
Hmmm this issue does not seem to follow the issue template. Make sure you provide all the required information.
Compiles fine for me. Make sure GCS typings (@types/google-cloud__storage package) are installed and visible to tsc. That is the typeRoots are defined correctly in the project config.
I have @types/google-cloud_storage package installed. and here is my tsconfig file.
Can you check if it is correct or not?

I have the same issue
You have specified types in the config. This means only reflect-metadata types are visible to the compiler.
See https://www.typescriptlang.org/docs/handbook/tsconfig-json.html
If types is specified, only packages listed will be included. For instance:
{
"compilerOptions": {
"types" : ["node", "lodash", "express"]
}
}
This tsconfig.json file will only include ./node_modules/@types/node, ./node_modules/@types/lodash and ./node_modules/@types/express. Other packages under node_modules/@types/* will not be included.
Even when i add,
"types": [
"reflect-metadata",
"google-cloud__storage"
],
it returns me the same error.
I add
"@google-cloud/storage": "^1.6.0",
"@types/google-cloud__storage": "^1.1.7",
to my package.json with the firebase-admin
"firebase-admin": "^5.12.0",
and I m having the same issue,
my tsconfig look like
{
"compilerOptions": {
"outDir": "dist",
"target": "es6",
"module": "commonjs",
"noImplicitAny": true,
"experimentalDecorators": true,
"removeComments": true,
"preserveConstEnums": true,
"emitDecoratorMetadata": true,
"sourceMap": false,
"rootDirs": [
"src",
"test",
"node_modules/@types"
]
},
"exclude": [
"node_modules"
]
}
in the typescript website says if you don't include typeRoots parameter the @types will be added automatically
I downgrade the library until 5.1.0 , after this one, my compilation start to fails
For now I am skipping lib check in typescript config until we've a workaround or a fix
"skipLibCheck": true,