Здравствуйте, я сталкиваюсь с этой ошибкой, используя Angular CLI почти 2 года. Я гуглил и не могу найти решение этой проблемы.
Can't resolve all parameters for BaseService in E:/**/web/src/app/shared/services/base.service.ts: ([object Object], ?, ?, ?). This will become an error in Angular v6.x
Когда я запускаю эту команду,
ng build --output-hashing none --prod --build-optimizer=false
Angular не удается собрать при сборке с тегом --prod , он показывает случайную ошибку, например:
ERROR in : Unexpected value 'component in E:/**/web/src/app/shared/index.ts' imported by the module 'BlotterModule in E:/***/web/src/app/modules/blotter/blotter.module.ts'. Please add a @NgModule annotation.
Индексный файл, упомянутый в сообщении об ошибке:
import * as Services from './services';
import * as directives from './directives';
import * as pipes from './pipes';
import * as component from './components';
import * as guards from './guards';
export {
component,
Services,
directives,
pipes,
guards
}
Мой пакет. json Файл
{
"name": "epricing",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng build --watch --output-hashing none && ng serve -o --proxy-config proxy.config.json ",
"build": "ng build --extract-css",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"mi:prod": "ng build --output-hashing none --base-href /DevInet.ePricing.MultiTaux.Web/",
"run:prod": "ng build --output-hashing none --prod --build-optimizer=false --base-href /DevInet.ePricing.MultiTaux.Web/"
},
"private": true,
"dependencies": {
"@angular/animations": "^6.1.10",
"@angular/cdk": "^7.0.2",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/forms": "^6.1.0",
"@angular/http": "^6.1.0",
"@angular/material": "^7.0.2",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/router": "^6.1.0",
"@ng-bootstrap/ng-bootstrap": "^2.0.0",
"@ng-select/ng-select": "^2.9.1",
"@ngrx/effects": "^6.1.0",
"@ngrx/entity": "^6.1.0",
"@ngrx/store": "^6.1.0",
"@ngrx/store-devtools": "^6.1.0",
"@sweetalert2/ngx-sweetalert2": "^5.1.0",
"angular-svg-round-progressbar": "^3.0.1",
"angular-user-idle": "^2.2.1",
"bootstrap": "^4.1.3",
"chart.js": "^2.8.0",
"core-js": "^2.5.4",
"file-saver": "^2.0.0",
"font-awesome": "^4.7.0",
"gsap": "^2.0.2",
"guid-typescript": "^1.0.9",
"hammerjs": "^2.0.8",
"imports-loader": "^0.8.0",
"jquery": "^3.3.1",
"lodash": "^4.17.11",
"moment": "^2.22.2",
"ng-circle-progress": "^1.5.1",
"ngrx-store-logger": "^0.2.2",
"ngx-bootstrap": "^3.2.0",
"ngx-cookie-service": "^2.1.0",
"ngx-toastr": "^9.1.0",
"node-sass": "^4.9.0",
"popper.js": "^1.14.3",
"primeicons": "^1.0.0-beta.10",
"primeng": "^6.0.2",
"rxjs": "^6.0.0",
"string": "^3.3.3",
"sweetalert2": "^8.13.6",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.7.0",
"@angular/cli": "~6.1.1",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@ngrx/schematics": "^6.1.0",
"@types/jasmine": "~2.8.6",
"@types/jasminewd2": "~2.0.3",
"@types/lodash": "^4.14.116",
"@types/node": "~8.9.4",
"chai": "^4.1.2",
"codelyzer": "~4.2.1",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~1.7.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.0",
"karma-jasmine": "~1.1.1",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.3.0",
"ts-node": "~5.0.1",
"tslint": "~5.9.1",
"typescript": "~2.7.2"
}
}
my tsconfig. json is
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist",
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types",
"node",
"greensock"
],
"lib": [
"es2017",
"dom"
]
}
}
Эта проблема становится для меня критической. Пожалуйста, может кто-нибудь попытаться посмотреть, если есть какие-либо проблемы, которые я не видел