Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/gwt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Angular 角度4:ng服务工作正常,但ng构建--prod失败_Angular_Angular Cli - Fatal编程技术网

Angular 角度4:ng服务工作正常,但ng构建--prod失败

Angular 角度4:ng服务工作正常,但ng构建--prod失败,angular,angular-cli,Angular,Angular Cli,当我尝试运行ng serve时,它运行时没有任何错误,但当我尝试使用“ng build--prod”创建生产生成时,它停止运行,出现以下错误。我试图调整版本,但仍然没有成功。然后出现了一些其他问题,如其他API版本兼容性问题。我们将非常感谢您的帮助 在./src/main.ts模块中找不到错误:错误:无法解决 “./$$\u gendir/app/app.module.ngfactory” “D:\000PS\workspace\u ui\dashboard\src”错误:元数据版本 模块不匹配

当我尝试运行
ng serve
时,它运行时没有任何错误,但当我尝试使用“
ng build--prod
”创建生产生成时,它停止运行,出现以下错误。我试图调整版本,但仍然没有成功。然后出现了一些其他问题,如其他API版本兼容性问题。我们将非常感谢您的帮助

在./src/main.ts模块中找不到错误:错误:无法解决 “./$$\u gendir/app/app.module.ngfactory” “D:\000PS\workspace\u ui\dashboard\src”错误:元数据版本 模块不匹配 D:/000PS/workspace\u ui/dashboard/node\u modules/ngx pipes/src/app/index.D.ts, 找到版本4,应为3 在StaticSymbolResolver.getModuleMetadata(D:\000PS\workspace\u ui\dashboard\node\u modules\@angular\compiler\bundles\compiler.umd.js:25755:34) 在StaticSymbolResolver.\u createSymbolsOf(D:\000PS\workspace\u ui\dashboard\node\u modules\@angular\compiler\bundles\compiler.umd.js:25543:46) 在StaticSymbolResolver.getSymbolsOf(D:\000PS\workspace\u ui\dashboard\node\u modules\@angular\compiler\bundles\compiler.umd.js:25524:14) 位于D:\000PS\workspace\u ui\dashboard\node\u modules\@angular\compiler\bundles\compiler.umd.js:24381:30 在Array.forEach()处 在extractProgramSymbols(D:\000PS\workspace\u ui\dashboard\node\u modules\@angular\compiler\bundles\compiler.umd.js:24380:79) 在AotCompiler.analyzeModulesAsync(D:\000PS\workspace\ui\dashboard\node\modules\@angular\compiler\bundles\compiler.umd.js:23936:47) 在CodeGenerator.codegen(D:\000PS\workspace\u ui\dashboard\node\u modules\@angular\compiler cli\src\codegen.js:32:14) 位于Function.NgTools\u InternalApi\u NG\u 2.codeGen(D:\000PS\workspace\ui\dashboard\node\modules\@angular\compiler cli\src\NgTools\u api.js:73:30) 在_donePromise.Promise.resolve.then(D:\000PS\workspace\u ui\dashboard\node\u modules\@ngtools\webpack\src\plugin.js:428:58) 在 在进程中。_tick回调(内部/process/next_tick.js:188:7)

请查找package.json以供参考:

{
  "name": "dashboard",
  "version": "1.0.1",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "4.4.4",
    "@angular/compiler": "4.4.4",
    "@angular/core": "4.4.4",
    "@angular/forms": "4.4.4",
    "@angular/http": "4.4.4",
    "@angular/platform-browser": "4.4.4",
    "@angular/platform-browser-dynamic": "4.4.4",
    "@angular/router": "4.4.4",
    "@ngui/map": "0.18.3",
    "@types/googlemaps": "3.26.14",
    "angular2-jwt": "^0.2.3",
    "bootstrap": "3.3.5",
    "bootstrap-notify": "3.1.3",
    "bootstrap-select": "1.12.2",
    "bootstrap-switch": "3.3.4",
    "bootstrap-tagsinput": "0.7.1",
    "chartist": "0.9.4",
    "chartist-plugin-zoom": "0.4.0",
    "chartjs-plugin-zoom": "0.5.0",
    "core-js": "2.4.1",
    "datatables": "1.10.12",
    "datatables.net-bs": "1.10.12",
    "datatables.net-responsive": "2.1.1",
    "easy-pie-chart": "2.1.7",
    "eonasdan-bootstrap-datetimepicker": "4.17.47",
    "fullcalendar": "3.4.0",
    "jasny-bootstrap": "3.1.3",
    "jquery": "1.12.4",
    "material-design-icons": "^3.0.1",
    "mdbootstrap": "^4.5.0",
    "ng2-fab-speed-dial": "^1.0.0-beta.5",
    "ngx-pipes": "^1.6.5",
    "nouislider": "9.2.0",
    "npm": "^5.8.0",
    "rxjs": "5.4.2",
    "time-ago-pipe": "1.2.1",
    "twitter-bootstrap-wizard": "^1.2.0",
    "web-animations-js": "2.2.2",
    "zone.js": "0.8.4"
  },
  "devDependencies": {
    "@angular/cli": "^1.7.4",
    "@angular/compiler-cli": "4.4.4",
    "@types/bootstrap": "3.3.32",
    "@types/chartist": "0.9.34",
    "@types/jasmine": "2.5.38",
    "@types/jquery": "1.10.31",
    "@types/node": "6.0.73",
    "angular2-jwt": "^0.2.3",
    "codelyzer": "2.0.0",
    "jasmine-core": "2.5.2",
    "jasmine-spec-reporter": "3.2.0",
    "karma": "1.4.1",
    "karma-chrome-launcher": "2.0.0",
    "karma-cli": "1.0.1",
    "karma-coverage-istanbul-reporter": "0.2.0",
    "karma-jasmine": "1.1.0",
    "karma-jasmine-html-reporter": "0.2.2",
    "protractor": "5.1.0",
    "ts-node": "2.0.0",
    "tslint": "4.5.0",
    "typescript": "2.4.2"
  }
}

您的angular版本是4.4,ngx pipes angular版本是5或更高。因此,安装ngx管道的版本与您的angular项目兼容


检查node_modules/ngx pipes/package.json内部以查找ngx pipes版本。

您的angular版本为4.4,ngx pipes angular版本为5或更高。因此,安装ngx管道的版本与您的angular项目兼容


检查node_modules/ngx pipes/package.json内部以查找ngx pipes版本。

看起来像是
ngx pipes
与您当前的angular版本不兼容,或者库本身有问题。看起来不错,但是ng serve工作得很好,还有没有任何选项可以用来创建产品构建,有无调整相对版本?尝试降级
ngx管道
您可以尝试ng构建--target=production。。一定要让我知道它是否工作。我尝试使用ng build--target=production进行构建,但再次失败。看起来
ngx pipes
与您当前的angular版本不兼容,或者库本身有问题。看起来,但是ng serve工作得很好,是否有任何选项可以创建产品构建,有无调整相对版本?尝试降级
ngx管道
您可以尝试ng构建--target=production。。一定要让我知道它是否工作。我尝试使用ng build--target=production构建,但再次失败。