ng build --prod "./node_modules/ng2-pdf-viewer/fesm5/ng2-pdf-viewer.js" 时出现错误

Getting ERROR while ng build --prod "./node_modules/ng2-pdf-viewer/fesm5/ng2-pdf-viewer.js"

对于生产构建,我正在使用 ng build --prod 命令但收到此错误


package.json

{
  "name": "convex",
  "version": "1.0.0",
  "homepage": "http://localhost:4200/",
  "license": "",
  "scripts": {
    "ng": "ng",
    "start": " ng serve --host 0.0.0.0",
    "build": "ng build",
    "dev-pull": "cd ../dev_build && git pull origin master",
    "prod-pull": "cd ../prod_build && git pull origin master",
    "build-dev": "npm run dev-pull && node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod --configuration=dev && cp ../dev_build/.htaccess.txt ../dev_build/dist/.htaccess && cd ../dev_build && git add . && git commit -m 'Dev Build' && git push origin master",
    "build-local": "ng build  --configuration=local && git add . && git commit -m 'Develop Build' && git push samagra local",
    "build-production": "npm run prod-pull && node --max_old_space_size=8192 node_modules/@angular/cli/bin/ng build --prod && cp ../prod_build/.htaccess.txt ../prod_build/dist/.htaccess && cd ../prod_build && git add . && git commit -m 'Prod Build' && git push origin master",
    "bp": "npm run build-production",
    "bd": "npm run build-dev",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "noreload": "ng serve --host 0.0.0.0 --live-reload false"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "^1.0.0-beta.5",
    "@angular/animations": "7.0.4",
    "@angular/cdk": "^7.3.7",
    "@angular/common": "7.0.4",
    "@angular/compiler": "7.0.4",
    "@angular/core": "7.0.4",
    "@angular/forms": "7.0.4",
    "@angular/http": "7.0.4",
    "@angular/platform-browser": "7.0.4",
    "@angular/platform-browser-dynamic": "7.0.4",
    "@angular/platform-server": "7.0.4",
    "@angular/pwa": "^0.13.9",
    "@angular/router": "7.0.4",
    "@angular/service-worker": "^7.2.15",
    "@ng-bootstrap/ng-bootstrap": "4.2.2",
    "@ng-select/ng-select": "2.12.1",
    "@ngrx/store": "6.1.0",
    "@ngx-gallery/core": "^4.0.3",
    "@ngx-gallery/gallerize": "^4.0.3",
    "@ngx-gallery/lightbox": "^4.0.3",
    "@ngx-translate/core": "10.0.2",
    "@ngx-translate/http-loader": "3.0.1",
    "@nicky-lenaers/ngx-scroll-to": "^2.0.0",
    "@swimlane/ngx-charts": "github:themsr/ngx-charts#master",
    "@swimlane/ngx-datatable": "13.1.0",
    "@types/d3-shape": "1.2.4",
    "angular-6-datatable": "^0.8.0",
    "angular-archwizard": "3.0.0",
    "angular-calendar": "0.26.3",
    "angular-datatables": "^7.0.0",
    "angular-file-uploader": "^5.0.2",
    "angular-moment": "^1.3.0",
    "angular2-multiselect-dropdown": "^4.2.7",
    "angular2-qrscanner": "^1.0.7",
    "angularx-qrcode": "^1.6.2",
    "bootstrap": "4.0.0",
    "bourbon": "5.0.1",
    "chartist": "0.11.0",
    "classlist.js": "1.1.20150312",
    "core-js": "2.5.3",
    "d3": "5.5.0",
    "date-fns": "1.29.0",
    "hammerjs": "^2.0.8",
    "http-server": "^0.11.1",
    "intl": "1.2.5",
    "jquery": "3.3.1",
    "lodash": "^4.17.15",
    "moment": "^2.24.0",
    "moment-range": "^4.0.2",
    "ng-chartist": "1.1.1",
    "ng-circle-progress": "^1.5.0",
    "ng-multiselect-dropdown": "^0.2.4",
    "ng-snotify": "4.3.1",
    "ng2-archwizard": "^2.1.0",
    "ng2-charts": "1.6.0",
    "ng2-dragula": "2.1.1",
    "ng2-file-upload": "1.3.0",
    "ng2-nouislider": "^1.8.2",
    "ng2-pdf-viewer": "^6.3.2",
    "ng2-smart-table": "1.3.5",
    "ng2-validation": "4.2.0",
    "ng5-slider": "^1.2.4",
    "ngb-modal": "^2.0.3",
    "ngx-bootstrap": "^5.1.1",
    "ngx-chips": "1.9.8",
    "ngx-gallery": "^5.10.0",
    "ngx-quill": "^4.8.0",
    "ngx-scroll-event": "^1.0.8",
    "ngx-swiper-wrapper": "^7.2.1",
    "ngx-ui-switch": "^7.0.1",
    "node-sass": "^4.13.1",
    "nouislider": "^13.1.5",
    "pubnub": "^4.24.3",
    "pubnub-angular2": "^1.3.2",
    "quill": "1.3.6",
    "resize-observer-polyfill": "1.4.2",
    "rxjs": "6.3.3",
    "screenfull": "3.3.1",
    "sweetalert2": "7.28.8",
    "videogular2": "6.3.0",
    "web-animations-js": "2.2.5",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.13.9",
    "@angular/cli": "7.0.6",
    "@angular/compiler-cli": "^7.2.15",
    "@angular/language-service": "7.0.4",
    "@types/chartist": "^0.9.46",
    "@types/jasmine": "2.8.6",
    "@types/jquery": "^3.3.30",
    "@types/lodash": "^4.14.136",
    "@types/node": "10.3.6",
    "codelyzer": "4.0.2",
    "jasmine-core": "3.1.0",
    "jasmine-spec-reporter": "4.2.1",
    "karma": "2.0.0",
    "karma-chrome-launcher": "2.2.0",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "2.0.1",
    "karma-jasmine": "1.1.1",
    "karma-jasmine-html-reporter": "1.1.0",
    "protractor": "5.3.0",
    "ts-node": "7.0.0",
    "tslint": "5.7.0",
    "typescript": "3.1.6"
  }
}

尝试更新您的

"@angular-devkit/build-angular": "^0.13.9",

依赖于较新的,例如0.1000.3