Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

cannot find module "firebase-functions"

I imported and downloaded: firebase-functions and firebase-admin using npm i <package> but it give me a lint error like: cannot find module "firebase-functions". I also restarted vscode, but problem persists..

screenhost 1 screenhost 2


Could it be problem with webpack or tsconfig?

Some important packages in package.json:

{
    "dependencies": {
    "@angular/animations": "^5.2.3",
    "@angular/cdk": "^5.1.1",
    "@angular/common": "^5.2.2",
    "@angular/compiler": "^5.2.2",
    "@angular/core": "^5.2.2",
    "@angular/forms": "^5.2.2",
    "@angular/http": "^5.2.2",
    "@angular/material": "^5.0.2",
    "@angular/material-moment-adapter": "^5.2.3",
    "@angular/platform-browser": "^5.2.2",
    "@angular/platform-browser-dynamic": "^5.2.2",
    "@angular/platform-server": "^5.2.3",
    "@angular/router": "~5.2.2",
    "core-js": "^2.5.3",
    "express": "^4.16.2",
    "firebase": "^4.9.1",
    "firebase-admin": "~5.8.1",
    "firebase-functions": "^0.8.1",
    "zone.js": "0.8.18"
  },
  "private": true,
  "devDependencies": {
    "@angular/cli": "^1.6.7",
    "@angular/compiler-cli": "^5.2.2",
    "@angular/language-service": "^4.2.4",
    "@types/jasmine": "~2.5.53",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "angular-universal-express-firebase": "0.0.4",
    "babel-preset-es2015": "^6.24.1",
    "codelyzer": "~3.1.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "npm-run-all": "^4.1.2",
    "protractor": "~5.1.2",
    "ts-loader": "^3.4.0",
    "ts-node": "~3.2.0",
    "tslint": "~5.3.2",
    "typescript": "^2.4.2",
    "webpack": "^3.8.1",
    "webpack-node-externals": "^1.6.0"
  }

}

like image 593
İbrahim Dolapci Avatar asked Dec 05 '22 12:12

İbrahim Dolapci


2 Answers

npm install firebase-functions
npm install firebase-admin
like image 130
Shaybakov Avatar answered Jan 05 '23 12:01

Shaybakov


You can try the following commands:

firebase use --add
firebase init functions

To get your project. Sometimes, its a permission problem. What you can try is creating a new account on your computer and doing the same commands, that almost always works.

like image 20
Argiator Morimoto Avatar answered Jan 05 '23 12:01

Argiator Morimoto