首页 > 解决方案 > ng 构建失败,由于包装不好?

问题描述

跑步时

  ng build --prod

使用这些包版本:

"@angular-devkit/core": "^0.4.2",
"@angular-devkit/schematics": "^0.4.2",
"@angular/animations": "^5.2.9",
"@angular/cdk": "^5.2.4",
"@angular/common": "^5.2.6",
"@angular/compiler": "^5.2.6",
"@angular/core": "^5.2.6",
"@angular/forms": "^5.2.6",
"@angular/http": "^5.2.6",
"@angular/platform-browser": "^5.2.6",
"@angular/platform-browser-dynamic": "^5.2.6",
"@angular/router": "^5.2.6",
"@ng-bootstrap/ng-bootstrap": "^1.1.0",

我收到以下错误。想法?

ERROR in ./node_modules/@ng-bootstrap/ng-bootstrap/alert/alert.ngfactory.js
Module build failed: Error: ./node_modules/@ng-bootstrap/ng-bootstrap/alert/alert.ngfactory.js is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format
    at AngularCompilerPlugin.getCompiledFile (./node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23)
    at plugin.done.then (./node_modules/@ngtools/webpack/src/loader.js:467:39)
    at <anonymous>
ERROR in ./node_modules/@ng-bootstrap/ng-bootstrap/datepicker/datepicker.ngfactory.js
Module build failed: Error: ./node_modules/@ng-bootstrap/ng-bootstrap/datepicker/datepicker.ngfactory.js is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format
    at AngularCompilerPlugin.getCompiledFile (./node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23)
    at plugin.done.then (./node_modules/@ngtools/webpack/src/loader.js:467:39)
    at <anonymous>
ERROR in ./node_modules/@ng-bootstrap/ng-bootstrap/modal/modal-backdrop.ngfactory.js
Module build failed: Error: ./node_modules/@ng-bootstrap/ng-bootstrap/modal/modal-backdrop.ngfactory.js is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format
    at AngularCompilerPlugin.getCompiledFile (./node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23)
    at plugin.done.then (./node_modules/@ngtools/webpack/src/loader.js:467:39)
    at <anonymous>
ERROR in ./node_modules/@ng-bootstrap/ng-bootstrap/modal/modal-window.ngfactory.js
Module build failed: Error: ./node_modules/@ng-bootstrap/ng-bootstrap/modal/modal-window.ngfactory.js is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format
    at AngularCompilerPlugin.getCompiledFile (./node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23)
    at plugin.done.then (./node_modules/@ngtools/webpack/src/loader.js:467:39)
    at <anonymous>
ERROR in ./node_modules/@ng-bootstrap/ng-bootstrap/popover/popover.ngfactory.js
Module build failed: Error: ./node_modules/@ng-bootstrap/ng-bootstrap/popover/popover.ngfactory.js is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format
    at AngularCompilerPlugin.getCompiledFile (./node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23)
    at plugin.done.then (./node_modules/@ngtools/webpack/src/loader.js:467:39)
    at <anonymous>
ERROR in ./node_modules/@ng-bootstrap/ng-bootstrap/tooltip/tooltip.ngfactory.js
Module build failed: Error: ./node_modules/@ng-bootstrap/ng-bootstrap/tooltip/tooltip.ngfactory.js is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format
    at AngularCompilerPlugin.getCompiledFile (./node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23)
    at plugin.done.then (./node_modules/@ngtools/webpack/src/loader.js:467:39)
    at <anonymous>
ERROR in ./node_modules/@ng-bootstrap/ng-bootstrap/typeahead/typeahead-window.ngfactory.js
Module build failed: Error: ./node_modules/@ng-bootstrap/ng-bootstrap/typeahead/typeahead-window.ngfactory.js is missing from the TypeScript compilation. Please make sure it is in your tsconfig via the 'files' or 'include' property.
The missing file seems to be part of a third party library. TS files in published libraries are often a sign of a badly packaged library. Please open an issue in the library repository to alert its author and ask them to package the library using the Angular Package Format
    at AngularCompilerPlugin.getCompiledFile (./node_modules/@ngtools/webpack/src/angular_compiler_plugin.js:674:23)
    at plugin.done.then (./node_modules/@ngtools/webpack/src/loader.js:467:39)
    at <anonymous>

标签: ng-bootstrap

解决方案


推荐阅读