【发布时间】:2022-01-02 22:01:08
【问题描述】:
我正在尝试安装 ngx-cookie 包,以便可以在我的应用程序中使用 CookieService。但是,我得到以下依赖冲突:
$ npm install ngx-cookie --save
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: angular-frontend@0.0.0
npm ERR! Found: @angular/core@13.0.3
npm ERR! node_modules/@angular/core
npm ERR! @angular/core@"~13.0.0" from the root project
npm ERR! peer @angular/core@">9.0.0" from ngx-cookie@5.0.2
npm ERR! node_modules/ngx-cookie
npm ERR! ngx-cookie@"*" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@"13.1.1" from @angular/common@13.1.1
npm ERR! node_modules/@angular/common
npm ERR! peer @angular/common@">9.0.0" from ngx-cookie@5.0.2
npm ERR! node_modules/ngx-cookie
npm ERR! ngx-cookie@"*" 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.
我尝试安装ngx-cookie-service,但我得到了同样的错误。
我该怎么办?是不是 Angular 版本的问题?
【问题讨论】:
标签: angular typescript npm cookies dependencies