Happened while trying to upgrade IONIC app from version 3 to 4
Updated all plugins and modules to latest available, without any luck.
ERROR in ./node
I faced this issue while migrating to angular 8.x.x .
Actually 'DOCUMENT' has been deprecated from '@angular/platform-browser' and is now part of '@angular/common'.
Older plugins still try to import document from '@angular/platform-browser' . Just check in the .js and .js.map files under 'fesm5' as well as 'fesm2015' folder of the plugin in node_modules section.
Better to update the specific plugin to latest angular compatible version.
In my case troubling plugin was 'ngx-clipboard'.