Angular 6 many Can't resolve errors (crypto, fs, http, https, net, path, stream, tls, zlib)

后端 未结 8 2099
暖寄归人
暖寄归人 2020-11-28 05:56

I\'m building an Angular 6 app, but every time I want to serve to localhost, I get these errors:

ERROR in ./node_modules/aws-sign2/index.js
Module not found         


        
8条回答
  •  眼角桃花
    2020-11-28 06:20

    If the none of the above helped, I just lost 4 hours diagnosing why an Angular app that compiled yesterday now wouldn't compile due to "Module Not Found" errors.

    The problem was that yesterday when I imported a class in one of my components, WebStorm pointed to an identically-named class in my backend node app like this:

    import { ClassName } from '../../../../../../../../my-node-server-app/class-name';

    It was then trying to compile all of the Node-specific modules that aren't compatible with an ES2015 browser app. If you're having the same problem and none of the above helps, check your imports! Hope I saved someone's sanity out there.

提交回复
热议问题