我在做"npm i ngx-slick-carousel --保存“时出错了。
我的版本是:
$ npm -v
7.6.1
$ node -v
v14.17.0
Angular CLI: 11.2.13错误是:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: irt-official@0.0.0
npm ERR! Found: @angular/common@11.2.14
npm ERR! node_modules/@angular/common
npm ERR! @angular/common@"~11.2.13" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^7.0.0 || ^8.0.0 || ^9.0.0" from ngx-slick-carousel@0.5.1
npm ERR! node_modules/ngx-slick-carousel
npm ERR! ngx-slick-carousel@"*" 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 ERR!
npm ERR! See C:\Users\malik\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\malik\AppData\Local\npm-cache\_logs\2021-05-19T14_13_57_035Z-debug.logpackage.json:
"@angular/animations": "~11.2.13",
"@angular/common": "~11.2.13",
"@angular/compiler": "~11.2.13",
"@angular/core": "~11.2.13",
"@angular/forms": "~11.2.13",
"@angular/platform-browser": "~11.2.13",
"@angular/platform-browser-dynamic": "~11.2.13",
"@angular/router": "~11.2.13",
"angular-animations": "^0.11.0",
"jquery": "^3.6.0",
"rxjs": "~6.6.0",
"slick-carousel": "^1.8.1",
"tslib": "^2.0.0",
"zone.js": "~0.11.3"请帮我解决这个问题。为什么我不能安装this.Thank你
更新1:
我删除了node_module和packagelock.json文件,并尝试执行"npm安装“,我现在得到了这个错误。
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: irt-official@0.0.0
npm ERR! Found: @angular/core@11.2.14
npm ERR! node_modules/@angular/core
npm ERR! @angular/core@"~11.2.13" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@"12.0.1" from @angular/animations@12.0.1
npm ERR! node_modules/@angular/animations
npm ERR! peer @angular/animations@">=6.0.0" from angular-animations@0.11.0
npm ERR! node_modules/angular-animations
npm ERR! angular-animations@"^0.11.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 ERR!
npm ERR! See C:\Users\malik\AppData\Local\npm-cache\eresolve-report.txt需要一份完整的报告。
更新2:
我已经完成了"npm安装--遗留-对等-deps“--这个命令安装了我的node_module,但是当我在安装之后执行"ng服务”时,我得到了这个错误。
出现了一个未处理的异常:目标入口点“@角/平台-浏览器/动画”缺少依赖项:
更新3:
我已经完全刷新了所有的东西,就像我已经卸载了节点和角cli并重新安装了一样。
节点版本16.2.0
国家预防机制-v: 7.6.1
角CLI: 12.0.1
现在我已经创建了新的项目"ng新的IRT-官方“,然后我再次尝试"npm安装ngx-光滑-旋转木马-保存”,现在我得到了这个错误。
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: irt-official@0.0.0
npm ERR! Found: @angular/common@12.0.1
npm ERR! node_modules/@angular/common
npm ERR! @angular/common@"~12.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^7.0.0 || ^8.0.0 || ^9.0.0" from ngx-slick-carousel@0.5.1
npm ERR! node_modules/ngx-slick-carousel
npm ERR! ngx-slick-carousel@"*" 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 更新4:
我在我的packege.json文件中手动添加了"ngx-slick-carousel":"0.5.1",然后在我的packege.json文件中添加了"npm安装-遗留对等-deps“,但是当我执行所有步骤时,我得到的错误如下:
Uncaught:$(.).owlCarousel不是函数
发布于 2021-05-19 15:03:34
更新
您似乎没有从https://www.npmjs.com/package/ngx-slick-carousel运行安装步骤。

以前的
您package.json正在寻找"@angular/common": "~11.2.13",但您已经安装了11.2.14版本
将package.json更新为
"@angular/common": "^11.2.13"或
"@angular/common": "^11.2.14"What's the difference between tilde(~) and caret(^) in package.json?
发布于 2021-05-19 14:37:31
您可以通过编辑节点模块中的内容,找到光滑的旋转木马文件夹,在那里找到版本历史记录--您需要在任何地方更新您看到的版本9和添加10和11。问题是,在投入生产之前,您还必须对多个代码进行安全性测试和单元测试--或者无论如何,您应该找到一个最新的旋转木马模块。
你看到的任何地方都可以将它改为下面的角度
"^7.0.0 \x\x{e76f}\\x{e76f}\x{
https://stackoverflow.com/questions/67604698
复制相似问题