1

I have tried several different methods for installing Firebase-Tools

npm install firebase-tools

npm i --save-dev @types/firebase-tools

npm install -g firebase-tools

But still when I add:

const firebase_tools = require("firebase-tools")

to my project, I get an error when deploying:

Could not find a declaration file for module 'firebase_tools'

in my Visual Studio Code.

I have tried following the below link, but their response was to use require, which I already am.

Could not find a declaration file for module 'firebase-tools'

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
bourkison
  • 101
  • 9

1 Answers1

-1

Have you tried:

npm install -s firebase-tools

Since your error happens when deploying, I am led to believe your package.json may not contain the firebase-tools dependency. You need to run the npm install command with the -s flag in order for it to be saved in the package.json

Jose V
  • 1,356
  • 1
  • 4
  • 12
  • I think you're corrrect RE package.json, as I cannot see the dependency there. But I just ran this and there was no change to my package.json file at all, despite everything going ahead smoothly. Is there a way to manually force it into package.json? – bourkison Jan 26 '21 at 20:39
  • You can add the dependency manually in your `package.json` by adding `"firebase-tools": "^9.2.2",` inside the `"dependencies": { },` field – Jose V Jan 27 '21 at 09:40