There should be more to the error, including the path to a full log file at the end.
Please include that log file as it is likely to contain the full details of why npm failed to build a required native component for one of the dependencies of the node you are trying to install.
Also, which version of pi os are you using (use cat /etc/os-release), make sure that the package build-essentialis installed, and make sure all packages are up to date by running sudo apt update && sudo apt full-upgrade
Make sure that runs without error.
There must be something unusual about your system. I wonder if the npm cache is messed up. I suggest opening a command window and going into the .node-red folder. Delete the folder node_modules (or rename it). Then run npm cache clean --force
then npm install
which will re-install all nodes that you have installed. This may take some time.
Assuming that all goes without error then npm install node-red-contrib-onvif