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

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

    You are using the latest version of Angular CLI. Some npm packages are no longer supported. It's now a built-in Node module. If you've depended on crypto, you should switch to the one that's built-in.

    To fix your issue with crypto, stream libs, go to,

    node_modules/@angular-devkit/build-angular/src/angular-cli-files/models/webpack-configs/browser.js

    file and do the following change,

    `node: {crypto: true, stream: true}`
    

提交回复
热议问题