问题描述
您能帮我解决这个错误吗?这是我的package.json错误我不断收到此错误:
Can you help me out with this error? this my package.json errorI keep getting this error:
node_modules/ngx-daterangepicker-material/daterangepicker.component.d.ts(59,9)中的错误:错误TS1086:无法在环境上下文中声明访问器.
ERROR in node_modules/ngx-daterangepicker-material/daterangepicker.component.d.ts(59,9): error TS1086: An accessor cannot be declared in an ambient context.
"@agm/core": "^1.0.0-beta.7",
"@angular/animations": "~8.0.3",
"@angular/cdk": "^8.1.1",
"@angular/common": "~8.0.3",
"@angular/compiler": "~8.0.3",
"@angular/core": "~8.0.3",
"@angular/forms": "~8.0.3",
"@angular/material": "^8.1.1",
"@angular/material-moment-adapter": "^8.1.1",
"@angular/platform-browser": "~8.0.3",
"@angular/platform-browser-dynamic": "~8.0.3",
"@angular/router": "~8.0.3",
"@fortawesome/angular-fontawesome": "^0.4.0",
"@fortawesome/fontawesome-svg-core": "^1.2.28",
"@fortawesome/free-solid-svg-icons": "^5.13.0",
"@syncfusion/ej2-angular-calendars": "^17.4.51",
"@types/jquery": "^3.3.35",
"acorn": "^6.4.1",
"angular-hammer": "^2.2.0",
"angular-svg-icon": "^8.0.0",
"bootstrap": "^4.3.1",
"mat-range-datepicker": "^1.0.5",
"moment": "^2.24.0",
"ng2-datepicker": "^2.3.1",
"ng2-tooltip-directive": "^2.9.20",
"ngx-daterangepicker-material": "^2.2.1",
"ngx-drag-scroll": "^8.0.0-beta.2",
"ngx-infinite-scroll": "^8.0.2",
"ngx-material-timepicker": "^5.5.1",
"popper.js": "^1.15.0",
"pretty-checkbox": "^3.0.3",
"rxjs": "~6.4.0",
"tslib": "^1.11.1",
"xlsx": "^0.15.6",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.800.6",
"@angular/cli": "~8.0.6",
"@angular/compiler-cli": "~8.0.3",
"@angular/language-service": "~8.0.3",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "^5.2.2",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.5.3",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.4.3"
}
``
thank you
推荐答案
对于metronic角度6.1.8,我花了8个小时,但解决了.
For metronic-angular 6.1.8, I spent 8 hours, but I solved.
- 删除了package-lock.json
- 删除了node_modules文件夹
- npm安装
如果执行ng serve
收到TS1086错误,请不要担心...
if you execute ng serve
received TS1086 error, don't worry...
现在启动:
- npm i [email protected]
- npm我的时刻@ 2.18.1
重新推出`ng服务,尽情享受吧! ;)
relaunch `ng serve enjoy! ;)
第一个解决方案解决了开发部分,但是在部署过程中存在问题.最终的解决方案是:
the first solution solved the development part, but there are problems during the deployment. The final solution is:
- 删除了package-lock.json
- 删除了node_modules文件夹
- 在package.json中,删除库ngx-daterangepicker-material("ngx-daterangepicker-material":"^ 2.1.11"->"ngx-daterangepicker-material":"2.1.11")中的(^)
- 将版本时间从^ 2.24.0增加到2.25.3(删除^,"moment":"^ 2.24.0"->"moment":"2.25.3",
现在所有工作都在进行...纱线服务和纱线制造. ;)
Now working all... both ng serve and yarn build. ;)
这篇关于错误ngx-daterangepicker-material无法在环境上下文中声明访问器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!