For all the developers with this error:
I’ve fixed this issue by installing not the latest version of the generator/widget
npm install -g @firstname.lastname@example.org
version 9.0.2 does work without issues
Thank you a lot.
I wanted to start learning widget development and then I got the same error.
Now I lost like 2h to find an error.
Mendix should make somekind of /lts version that is used in tutorials and overall better document what is going on with that.