10

I have Cloud functions project and i moved the project from my old laptop to my new laptop.

I have installed everything that necessary. My problem is when i try firebase deploy it gives me that error:

! functions: package.json indicates an outdated version of firebase-functions. Please upgrade using npm install --save firebase-functions@latest in your functions directory.

I did that i have been told, but still it gives me the same error. What should i do? And how i direct the npm install to my functions directory?

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
E.Bolandian
  • 553
  • 10
  • 35
  • 1
    I am having the same issue. I have followed the instructions to install firebase-functions@latest IN the functions folder as well as installed latest firebase-tools in top-level folder. I still get same error. Anyone? I've tried all 3 solutions posed here. – Jeremy Irons Nov 28 '22 at 21:51

3 Answers3

6

You need to run sudo npm install --save firebase-functions@latest in your functions directory. Cannot be in any other directory.

In Flutter this will be in

/path_to_your_flutter_project/functions

Hope this helped someone

Zenko
  • 2,319
  • 2
  • 20
  • 46
0

I had the same problem. You just need to run npm install -g firebase-tools

npm install -g firebase-tools
/usr/local/bin/firebase -> /usr/local/lib/node_modules/firebase-tools/lib/bin/firebase.js
+ firebase-tools@7.0.0

That fixed my problem.

Mikael
  • 2,355
  • 1
  • 21
  • 45
0

Update firebase-admin and make sure your root package.json file points to your functions folder

Jonathan
  • 3,893
  • 5
  • 46
  • 77