Firebase cloud function exits with code 16 what is error code 16 and where can I find more info?

前端 未结 4 427
悲哀的现实
悲哀的现实 2020-12-17 09:27

one of my cloud functions on firebase exits with code 16 as an error.

I tried to google and find out what that code is but no luck at all.

Error: P         


        
4条回答
  •  一个人的身影
    2020-12-17 09:47

    Had the same issue. As @cDitch mentions my code was not 100% complete. However the biggest issue for me were outdated packages.

    I needed to upgrade firebase-admin, firebase-functions and firebase-tools as well as eslint.

    you can see which packages are outdated by running:

    npm outdated
    

    Then i've changed the dependencies manually inside the package.json to the latest version mentioned by npm outdated.

    It's possible that it'll cause deploy issues after you do this. At least this is what happened to me. Completely removing the node_modules and reinstalling them fixed this.

    Here's two lines i've added to my package.json scripts to do this on windows:

    "clean": "rmdir /s /q node_modules",
    "reinstall": "npm run clean && npm install",
    
    • rmdir -> delete a directory
    • /s -> delete the whole tree (so all folder within)
    • /q -> do this quietly so you dont flood your terminal and have to wait all printed lines.

    now you can run the following command

    npm run clean
    npm install
    

    or

    npm run reinstall
    

    to execute those steps.

提交回复
热议问题