0

I am getting an error message

Build failed: npm ERR! Cannot read property 'firebase-admin' of undefined\n\nnpm ERR! 
A complete log of this run can be found in:\nnpm ERR!
/www-data-home/.npm/_logs/2022-11-23T04_36_44_234Z-debug.log; Error ID: beaf8772"

Where is this www-data-home location?

giorgio79
  • 3,787
  • 9
  • 53
  • 85

2 Answers2

3

I was having the same error, updated package.json to use engine: 16, deployed again and then it worked (believe it forced updating all npm that could have been corrupted remotely).

eldermao
  • 633
  • 8
  • 18
2

As mentioned in this documentation on Viewing logs

Logs for Cloud Functions are viewable either in the Google Cloud Console, Cloud Logging UI, or via the firebase command-line tool.

Using the Firebase CLI To view logs with the firebase tool, use the functions:log command: firebase functions:log

To view logs for a specific function, provide the function name as an argument:

firebase functions:log --only <FUNCTION_NAME> For the full range of log viewing options, view the help for functions:log:

firebase help functions:log

You can view logs for Cloud Functions in the Cloud Logging UI using filter as those resource types

resource.type="cloud_function"

Refer this npm docs on npm logging.

The npm CLI has various mechanisms for showing different levels of information back to end-users for certain commands, configurations & environments.

All logs are written to a debug log, with the path to that file printed if the execution of a command fails.You can find the npm-debug.log file in your .npm directory. To find your .npm directory, use npm config get cache.

You can also check this stackoverflow thread

Sathi Aiswarya
  • 2,068
  • 2
  • 11