Did you use the https://www.npmjs.com/package/@mendix/generator-widget Mendix generator widget to scaffold your widget project? It should work if done via the generator.
You can also try installing the missing ‘pluggable-widget-tools’ using : npm install @mendix/pluggable-widgets-tools
Try to run the following command instead of this : npm install @mendix/generator-widget -g
npm i @firstname.lastname@example.org -g
You can refer the following link, whenever you are facing an issue while executing the command to install Mendix Pluggable Widget Generator. Sometimes this issue can be fixed by running the specific versions & can find respected dependencies.
And also check this link for latest issues, updates etc : https://github.com/mendix/widgets-resources/pulls
Mendix has released a new version of this course that no longer has this error.