angular - 运行 ng build 导致错误:无法创建长度超过 0x3fffffe7 个字符的字符串
问题描述
卡住了,需要别人的帮助!
构建 Angular 7 应用程序时遇到问题。在我的应用程序中添加了以下模块:
npm install @stomp/stompjs@5.4.4
npm install sockjs-client@1.4.0
现在执行 ng build 时出现以下错误,如下所示:
[myApp-4.0]$ ng build --prod --base-href=/myApp/ --deploy-url=/myApp/
无法在 Object.fileBufferToString (/my_app/) 的 Buffer.toString (buffer.js:667:10) 处创建长度超过 0x3fffffe7 个字符的字符串myApp/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/virtual-fs/host/buffer.js:37:40) 在 MapSubscriber._host.read.pipe.operators_1.map.buffer [as项目] (/my_app/myApp/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/workspace/workspace.js:220:116) 在 MapSubscriber._next (/my_app/myApp/node_modules/@angular /cli/node_modules/rxjs/internal/operators/map.js:49:35) 在 MapSubscriber.Subscriber.next (/my_app/myApp/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:67: 18) 在 Observable.rxjs_1.Observable。obs [as _subscribe] (/my_app/myApp/node_modules/@angular/cli/node_modules/@angular-devkit/core/node/host.js:172:21) 在 Observable._trySubscribe (/my_app/myApp/node_modules/@ angular/cli/node_modules/rxjs/internal/Observable.js:44:25) 在 Observable.subscribe (/my_app/myApp/node_modules/@angular/cli/node_modules/rxjs/internal/Observable.js:30:22) 在MapOperator.call (/my_app/myApp/node_modules/@angular/cli/node_modules/rxjs/internal/operators/map.js:32:23) 在 Observable.subscribe (/my_app/myApp/node_modules/@angular/cli/node_modules /rxjs/internal/Observable.js:25:22) 在 MapOperator.call (/my_app/myApp/node_modules/@angular/cli/node_modules/rxjs/internal/operators/map.js:32:23) 在 Observable.subscribe (/my_app/myApp/node_modules/@angular/cli/node_modules/rxjs/internal/Observable.js:25:22) 在 /my_app/myApp/node_modules/@angular/cli/node_modules/rxjs/internal/util/subscribeTo.js:22:31 在 Object.subscribeToResult (/my_app/myApp/node_modules/@angular/cli/node_modules/rxjs /internal/util/subscribeToResult.js:10:45) 在 MergeMapSubscriber._innerSub (/my_app/myApp/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:82:29)
任何帮助将不胜感激。
解决方案
尝试增加节点内存大小节点示例“--max_old_space_size=4096”,而不是 4096,您可以放置您喜欢的大小(支持 PC),您也可以查看此链接 链接
推荐阅读
- performance - PowerShell - Compare Folder Names in Directory to File Names
- c# - 通过 SOAP 从 Azure 应用服务查询 SSRS 服务器以获取报告参数
- google-apps-script - 如何将对象数据粘贴到谷歌表格?
- python - 将 ipywidget 中下拉选项的所有值传递给 pandas 数据框以进行切片
- mongodb - 有什么方法可以将值从谷歌表更新到 mongodb
- p-value - 在 gtsummary 表生成的 p 值中使用科学记数法
- javascript - 在对象中绑定函数调用
- python - CTypes在python中返回向量错误
- sql - 将 3d 时间段分解为每日
- visual-studio-code - 无法通过 vscode 扩展 webview 访问字体文件(off, woff2, ttf)