js中的警告未找到模块

js中的警告未找到模块

本文介绍了./node_modules/pdfjs-dist/build/pdf.js中的警告未找到模块:错误:无法解析'ui_angular_6 \ node_modules \ pdfjs-dist \ build'中的'zlib'的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将我的5号角代码迁移到6号角.

I was trying to migrate my angular 5 code to angular 6.

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

After doing npm start getting the below problem

   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'

Package.json

Package.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"
    }

请帮助我解决此问题.

推荐答案

以下PR https://github.com/mozilla/pdf.js/pull/9924 (在12天前合并).您可能需要升级到最新的"pdfjs-dist"来解决该问题.

There was a fix for this issue in the following PR https://github.com/mozilla/pdf.js/pull/9924 (merged 12 days ago). You may want upgrading to the latest "pdfjs-dist" to fix the issue.

这篇关于./node_modules/pdfjs-dist/build/pdf.js中的警告未找到模块:错误:无法解析'ui_angular_6 \ node_modules \ pdfjs-dist \ build'中的'zlib'的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-13 06:19