I've been looking fo the exact same question but i couldnt find it. Could someone tell me what is wrong with this?
Firebase deploy error command
this worked for me
firstly i ran sudo npm install npm -g
sudo npm install npm -g
secondly npm install in the functions folder
npm install