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 @mendix/generator-widget@8.13.0 -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.
https://www.npmjs.com/package/@mendix/generator-widget
And also check this link for latest issues, updates etc : https://github.com/mendix/widgets-resources/pulls
You need to uninstall node_moudle and then put the command in your termenal npm install
Mendix has released a new version of this course that no longer has this error.