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

后端 未结 8 2114
暖寄归人
暖寄归人 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

    This is caused by dependencies importing node modules that are not available in the browser. Add to your package.json the modules that give errors:

    "browser": {
        "http": false,
        "https":false,
        "net": false,
        "path": false,
        "stream": false,
        "tls": false
    }
    

提交回复
热议问题