Is there some custom widget added? If so, always use 'Tools' > 'Check Widgets' before deploying to an actual node. To mimic cloud widget bundling, you can also use 'Bundle widgets when running locally' and set it to true. This setting can be found at: 'Project' > 'Settings' > 'Modeler'. If either goes wrong, navigate to
<yourproject>\deployment\data\tmp\dojo\build-report.txt and search for errors in that file to locate what widget and specific widgetfile is causing the issue.
The reason behind all of this is that Mendix uses Webpack to bundle widgets when running in the cloud for optimization purposes. When ticking 'bundle widgets when running locally' this feature is mimiced.
Like Andries mentioned in his comment, I sometimes get this error when trying to bundle widgets when my project is opened from a network path starting with (`\\`). When I open the project from the mapped network drive (i.e. (`Y:\`) or the like) I am able to build. Can you please try opening your project from the mapped network (letter) drive?