使用模板时出错 @akveo/ng2-completer
Error to use the template @akveo/ng2-completer
我尝试 运行 一个使用模板 AKVeo 的 Angular 应用程序,但遇到下一个错误:
ERROR in node_modules/@akveo/ng2-completer/src/components/completer-cmp.d.ts(54,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/components/completer-cmp.d.ts(55,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/components/completer-cmp.d.ts(56,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/components/completer-cmp.d.ts(57,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/components/completer-cmp.d.ts(65,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/components/completer-cmp.d.ts(66,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/components/completer-cmp.d.ts(67,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-completer.d.ts(42,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-completer.d.ts(43,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-completer.d.ts(44,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-completer.d.ts(45,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-completer.d.ts(46,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-input.d.ts(27,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-input.d.ts(28,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-list.d.ts(32,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-list.d.ts(33,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-row.d.ts(13,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-row.d.ts(14,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/ng2-smart-table/lib/components/tbody/tbody.component.d.ts(29,9): error TS1086: An accessor cannot be declared in an ambient context.
有解决办法吗?
package.json:
{
"name": "qax-ui",
"version": "4.0.1",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/akveo/ngx-admin.git"
},
"bugs": {
"url": "https://github.com/akveo/ngx-admin/issues"
},
"scripts": {
"ng": "ng",
"conventional-changelog": "conventional-changelog",
"start": "ng serve",
"build": "ng build",
"build-bundle": "ng build",
"build:prod": "npm run build -- --prod --aot",
"test": "ng test",
"test:coverage": "rimraf coverage && npm run test -- --code-coverage",
"lint": "ng lint",
"lint:fix": "ng lint ngx-admin-demo --fix",
"lint:styles": "stylelint ./src/**/*.scss",
"lint:ci": "npm run lint && npm run lint:styles",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "ng e2e",
"docs": "compodoc -p src/tsconfig.app.json -d docs",
"docs:serve": "compodoc -p src/tsconfig.app.json -d docs -s",
"prepush": "npm run lint:ci",
"release:changelog": "npm run conventional-changelog -- -p angular -i CHANGELOG.md -s"
},
"dependencies": {
"@agm/core": "^1.1.0",
"@angular/animations": "^8.2.14",
"@angular/cdk": "^8.2.3",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/core": "^8.2.14",
"@angular/forms": "^8.2.14",
"@angular/http": "^7.2.16",
"@angular/material": "^8.2.3",
"@angular/platform-browser": "^8.2.14",
"@angular/platform-browser-dynamic": "^8.2.14",
"@angular/router": "^8.2.14",
"@nebular/auth": "4.1.2",
"@nebular/eva-icons": "^4.1.2",
"@nebular/security": "4.1.2",
"@nebular/theme": "^4.1.2",
"bootstrap": "4.3.1",
"classlist.js": "1.1.20150312",
"core-js": "2.5.1",
"cors": "^2.8.5",
"eva-icons": "^1.1.3",
"hammerjs": "^2.0.8",
"intl": "1.2.5",
"ionicons": "2.0.1",
"nebular-icons": "1.1.0",
"ng2-smart-table": "^1.5.0",
"ngx-mega-simple-drag-drop-list": "^1.0.8",
"ngx-smart-table": "^2.0.3",
"node-sass": "^4.13.1",
"normalize.css": "6.0.0",
"pace-js": "1.0.2",
"roboto-fontface": "0.8.0",
"rxjs": "6.5.2",
"rxjs-compat": "6.3.0",
"socicon": "3.0.5",
"typeface-exo": "0.0.22",
"web-animations-js": "github:angular/web-animations-js#release_pr208",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.800.6",
"@angular/cli": "^8.3.23",
"@angular/compiler-cli": "^8.2.14",
"@angular/language-service": "8.0.0",
"@compodoc/compodoc": "1.0.1",
"@types/jasmine": "2.5.54",
"@types/jasminewd2": "2.0.3",
"@types/node": "6.0.90",
"codelyzer": "^5.2.1",
"conventional-changelog-cli": "1.3.4",
"husky": "0.13.3",
"jasmine-core": "2.6.4",
"jasmine-spec-reporter": "4.1.1",
"karma": "1.7.1",
"karma-chrome-launcher": "2.1.1",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.3.0",
"karma-jasmine": "1.1.0",
"karma-jasmine-html-reporter": "0.2.2",
"ng2-completer": "^3.0.2",
"npm-run-all": "4.0.2",
"protractor": "5.1.2",
"rimraf": "2.6.1",
"stylelint": "7.13.0",
"ts-node": "3.2.2",
"tslint": "^5.20.1",
"tslint-language-service": "^0.9.9",
"typescript": "^3.5.3"
}
}
在tsconfig.ts中添加:
"compilerOptions": {
...
"skipLibCheck": true,
}
我尝试 运行 一个使用模板 AKVeo 的 Angular 应用程序,但遇到下一个错误:
ERROR in node_modules/@akveo/ng2-completer/src/components/completer-cmp.d.ts(54,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/components/completer-cmp.d.ts(55,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/components/completer-cmp.d.ts(56,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/components/completer-cmp.d.ts(57,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/components/completer-cmp.d.ts(65,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/components/completer-cmp.d.ts(66,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/components/completer-cmp.d.ts(67,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-completer.d.ts(42,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-completer.d.ts(43,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-completer.d.ts(44,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-completer.d.ts(45,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-completer.d.ts(46,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-input.d.ts(27,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-input.d.ts(28,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-list.d.ts(32,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-list.d.ts(33,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-row.d.ts(13,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/@akveo/ng2-completer/src/directives/ctr-row.d.ts(14,9): error TS1086: An accessor cannot be declared in an ambient context.
node_modules/ng2-smart-table/lib/components/tbody/tbody.component.d.ts(29,9): error TS1086: An accessor cannot be declared in an ambient context.
有解决办法吗?
package.json:
{
"name": "qax-ui",
"version": "4.0.1",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/akveo/ngx-admin.git"
},
"bugs": {
"url": "https://github.com/akveo/ngx-admin/issues"
},
"scripts": {
"ng": "ng",
"conventional-changelog": "conventional-changelog",
"start": "ng serve",
"build": "ng build",
"build-bundle": "ng build",
"build:prod": "npm run build -- --prod --aot",
"test": "ng test",
"test:coverage": "rimraf coverage && npm run test -- --code-coverage",
"lint": "ng lint",
"lint:fix": "ng lint ngx-admin-demo --fix",
"lint:styles": "stylelint ./src/**/*.scss",
"lint:ci": "npm run lint && npm run lint:styles",
"pree2e": "webdriver-manager update --standalone false --gecko false",
"e2e": "ng e2e",
"docs": "compodoc -p src/tsconfig.app.json -d docs",
"docs:serve": "compodoc -p src/tsconfig.app.json -d docs -s",
"prepush": "npm run lint:ci",
"release:changelog": "npm run conventional-changelog -- -p angular -i CHANGELOG.md -s"
},
"dependencies": {
"@agm/core": "^1.1.0",
"@angular/animations": "^8.2.14",
"@angular/cdk": "^8.2.3",
"@angular/common": "^8.2.14",
"@angular/compiler": "^8.2.14",
"@angular/core": "^8.2.14",
"@angular/forms": "^8.2.14",
"@angular/http": "^7.2.16",
"@angular/material": "^8.2.3",
"@angular/platform-browser": "^8.2.14",
"@angular/platform-browser-dynamic": "^8.2.14",
"@angular/router": "^8.2.14",
"@nebular/auth": "4.1.2",
"@nebular/eva-icons": "^4.1.2",
"@nebular/security": "4.1.2",
"@nebular/theme": "^4.1.2",
"bootstrap": "4.3.1",
"classlist.js": "1.1.20150312",
"core-js": "2.5.1",
"cors": "^2.8.5",
"eva-icons": "^1.1.3",
"hammerjs": "^2.0.8",
"intl": "1.2.5",
"ionicons": "2.0.1",
"nebular-icons": "1.1.0",
"ng2-smart-table": "^1.5.0",
"ngx-mega-simple-drag-drop-list": "^1.0.8",
"ngx-smart-table": "^2.0.3",
"node-sass": "^4.13.1",
"normalize.css": "6.0.0",
"pace-js": "1.0.2",
"roboto-fontface": "0.8.0",
"rxjs": "6.5.2",
"rxjs-compat": "6.3.0",
"socicon": "3.0.5",
"typeface-exo": "0.0.22",
"web-animations-js": "github:angular/web-animations-js#release_pr208",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.800.6",
"@angular/cli": "^8.3.23",
"@angular/compiler-cli": "^8.2.14",
"@angular/language-service": "8.0.0",
"@compodoc/compodoc": "1.0.1",
"@types/jasmine": "2.5.54",
"@types/jasminewd2": "2.0.3",
"@types/node": "6.0.90",
"codelyzer": "^5.2.1",
"conventional-changelog-cli": "1.3.4",
"husky": "0.13.3",
"jasmine-core": "2.6.4",
"jasmine-spec-reporter": "4.1.1",
"karma": "1.7.1",
"karma-chrome-launcher": "2.1.1",
"karma-cli": "1.0.1",
"karma-coverage-istanbul-reporter": "1.3.0",
"karma-jasmine": "1.1.0",
"karma-jasmine-html-reporter": "0.2.2",
"ng2-completer": "^3.0.2",
"npm-run-all": "4.0.2",
"protractor": "5.1.2",
"rimraf": "2.6.1",
"stylelint": "7.13.0",
"ts-node": "3.2.2",
"tslint": "^5.20.1",
"tslint-language-service": "^0.9.9",
"typescript": "^3.5.3"
}
}
在tsconfig.ts中添加:
"compilerOptions": {
...
"skipLibCheck": true,
}