gpt4 book ai didi

angular6 - ./node_modules/pdfjs-dist/build/pdf.js 中的警告未找到模块 : Error: Can't resolve 'zlib' in 'ui_angular_6\node_modules\pdfjs-dist\build'

转载 作者:行者123 更新时间:2023-12-02 19:03:41 29 4
gpt4 key购买 nike

我试图将我的 Angular 5 代码迁移到 Angular 6。

执行 npm 后开始出现以下问题

   npm start

WARNING in ./node_modules/pdfjs-dist/build/pdf.js
Module not found: Error: Can't resolve 'zlib' in '\ui_angular_6\node_modules\pdfjs-dist\build'

包.json

  "dependencies": {
"@angular/animations": "6.0.2",
"@angular/common": "6.0.2",
"@angular/compiler": "6.0.2",
"@angular/core": "6.0.2",
"@angular/flex-layout": "^6.0.0-beta.15",
"@angular/forms": "6.0.2",
"@angular/http": "6.0.2",
"@angular/platform-browser": "6.0.2",
"@angular/platform-browser-dynamic": "6.0.2",
"@angular/router": "6.0.2",
"@ng-bootstrap/ng-bootstrap": "^1.1.2",
"angular-font-awesome": "^3.1.2",
"body-parser": "^1.18.2",
"bootstrap": "^4.1.0",
"core-js": "^2.4.1",
"elasticsearch": "^15.1.1",
"elasticsearch-browser": "^15.1.1",
"express": "^4.16.3",
"font-awesome": "^4.7.0",
"jquery": "^3.3.1",
"ng2-pdf-viewer": "^5.1.1",
"npm": "^6.0.1",
"popper.js": "^1.14.3",
"rxjs": "^6.1.0",
"rxjs-compat": "^6.1.0",
"underscore": "^1.8.3",
"zone.js": "^0.8.26"
}

请帮我解决这个问题。

最佳答案

尝试将其放入您的 package.json 文件中:

"browser": {    
"zlib":false }

关于angular6 - ./node_modules/pdfjs-dist/build/pdf.js 中的警告未找到模块 : Error: Can't resolve 'zlib' in 'ui_angular_6\node_modules\pdfjs-dist\build' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51410711/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com