Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
327 views
in Technique[技术] by (71.8m points)

node.js - Could not find a declaration file for module 'firebase-tools', despite installing and requiring

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'

question from:https://stackoverflow.com/questions/65895180/could-not-find-a-declaration-file-for-module-firebase-tools-despite-installin

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...