Angular CLI: 14.2.3
Node: 16.15.1
Package Manager: npm 8.12.1
OS: darwin x64
我正在安装角引导程序(试图)从NPM获得以下错误
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: tractapp@0.0.0
npm ERR! Found: @angular/core@14.2.2
npm ERR! node_modules/@angular/core
npm ERR! peer @angular/core@"14.2.2" from @angular/animations@14.2.2
npm ERR! node_modules/@angular/animations
npm ERR! peer @angular/animations@"^14.0.0 || ^15.0.0" from @angular/material@14.2.2
npm ERR! node_modules/@angular/material
npm ERR! @angular/material@"^14.2.2" from the root project
npm ERR! peerOptional @angular/animations@"14.2.2" from @angular/platform-browser@14.2.2
npm ERR! node_modules/@angular/platform-browser
npm ERR! peer @angular/platform-browser@"^12.0.0 || ^13.0.0 || ^14.0.0" from @angular/fire@7.4.1
npm ERR! node_modules/@angular/fire
npm ERR! @angular/fire@"^7.4.1" from the root project
npm ERR! 6 more (@angular/forms, @angular/material, ...)
npm ERR! 2 more (@swimlane/ngx-charts, the root project)
npm ERR! peer @angular/core@"^14.0.0 || ^15.0.0" from @angular/cdk@14.2.2
npm ERR! node_modules/@angular/cdk
npm ERR! peer @angular/cdk@"14.2.2" from @angular/material@14.2.2
npm ERR! node_modules/@angular/material
npm ERR! @angular/material@"^14.2.2" from the root project
npm ERR! peer @angular/cdk@">=12.0.0" from @swimlane/ngx-charts@20.1.0
npm ERR! node_modules/@swimlane/ngx-charts
npm ERR! @swimlane/ngx-charts@"^20.1.0" from the root project
npm ERR! 2 more (ng2-charts, the root project)
npm ERR! 16 more (@angular/common, @angular/compiler, @angular/fire, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @ng-bootstrap/ng-bootstrap@"13.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @angular/core@14.2.6
npm ERR! node_modules/@angular/core
npm ERR! peer @angular/core@"14.2.6" from @angular/forms@14.2.6
npm ERR! node_modules/@angular/forms
npm ERR! @angular/forms@"^14.2.0" from the root project
npm ERR! peer @angular/forms@"^14.1.0" from @ng-bootstrap/ng-bootstrap@13.0.0
npm ERR! node_modules/@ng-bootstrap/ng-bootstrap
npm ERR! @ng-bootstrap/ng-bootstrap@"13.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
NPM的错误和这些都不是我理解的强项,如果有人能帮我指出正确的方向,我会很高兴的。
谢谢!
这也是我的package.json文件,我假设在错误形成/声明的过程中,它会出现一些问题。
{
"name": "tractapp",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test"
},
"private": true,
"dependencies": {
"@angular/animations": "^14.2.0",
"@angular/cdk": "^14.2.2",
"@angular/common": "^14.2.0",
"@angular/compiler": "^14.2.0",
"@angular/core": "^14.2.0",
"@angular/fire": "^7.4.1",
"@angular/forms": "^14.2.0",
"@angular/material": "^14.2.2",
"@angular/platform-browser": "^14.2.0",
"@angular/platform-browser-dynamic": "^14.2.0",
"@angular/router": "^14.2.0",
"@fortawesome/angular-fontawesome": "^0.11.1",
"@fortawesome/fontawesome-svg-core": "^6.2.0",
"@fortawesome/free-solid-svg-icons": "^6.2.0",
"@stripe/stripe-js": "^1.37.0",
"@sweetalert2/ngx-sweetalert2": "^12.0.1",
"@swimlane/ngx-charts": "^20.1.0",
"aos": "^2.3.4",
"apexcharts": "^3.35.5",
"chart.js": "^3.9.1",
"ng-apexcharts": "^1.7.1",
"ng2-charts": "^4.0.1",
"ngx-print": "^1.2.1",
"ngx-stripe": "^14.1.0",
"rxjs": "~7.5.0",
"stripe": "^10.11.0",
"sweetalert2": "^11.5.1",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},
"devDependencies": {
"@angular-devkit/build-angular": "^14.2.3",
"@angular/cli": "~14.2.3",
"@angular/compiler-cli": "^14.2.0",
"@types/d3": "^7.4.0",
"@types/jasmine": "~4.0.0",
"jasmine-core": "~4.3.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.0.0",
"typescript": "~4.7.2"
}
}
发布于 2022-10-13 00:59:46
根据OP的请求将注释移到答复中,这样问题就可以被标记为解决了。
查看Github发布页面 (在10/12/22上访问13.0.0版),目前对库的最大支持是角14.1,因为您使用的是14.2.2。这似乎是一个版本兼容性问题(从本质上说,库正在尝试提取一个较旧版本的trying,而您正在发生冲突)。
你要么降低你的角度版本,要么用别的东西。
发布于 2022-11-02 11:55:53
npm的更新对我来说是完美的:
发布于 2022-10-14 10:31:17
在vs代码终端中安装ng引导程序之前运行npm更新,这将修复它。
https://stackoverflow.com/questions/74049258
复制相似问题