'Error: Cannot find module 'semver' when I run firebase deploy--only functions

When I run firebase deploy --only functions on Node.js command prompt, I got this error.

Command prompt error



Solution 1:[1]

for me, I workaround updating npm:

 npm update -g

now it deploys when doing:

firebase deploy --only functions

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ricardo Figueiredo