【问题标题】:Can't resolve 'buffer' in 'C:\Portal\\node_modules\string_decoder\node_modules\safe-buffer'无法解析 'C:\Portal\\node_modules\string_decoder\node_modules\safe-buffer' 中的 'buffer'
【发布时间】:2020-08-21 05:21:27
【问题描述】:

我正在尝试构建我的 Angular 项目并遇到以下错误:

Build Command: node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod

我的 Angular 版本是 :@angular/cli: "^8.2.2"。

我尝试重新安装 nodejs 12.13 并删除了 npm-cache 仍然无法正常工作

错误:-

ERROR in ./node_modules/string_decoder/node_modules/safe-buffer/index.js
Module not found: Error: Can't resolve 'buffer' in 

【问题讨论】:

    标签: node.js angular angular-cli


    【解决方案1】:
    "browser": {
        "buffer": false
    }
    

    在你的 package.json 中应该可以解决问题。

    【讨论】:

      猜你喜欢
      • 2017-03-02
      • 1970-01-01
      • 2022-01-04
      • 2022-11-17
      • 1970-01-01
      • 2018-11-18
      • 2019-08-09
      • 2023-03-16
      • 1970-01-01
      相关资源
      最近更新 更多