【发布时间】:2022-08-14 20:37:24
【问题描述】:
我尝试在终端中运行此命令:
npm i moment @angular/material-moment-adapter.
我收到错误:
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: xxxxxxxx-xx@0.0.0 npm ERR! Found: @angular/core@10.2.5
npm ERR! node_modules/@angular/core
npm ERR! @angular/core@\"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0\" from the root project
npm ERR! npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@\"^14.0.0 || ^15.0.0\" from @angular/material-moment-adapter@14.1.1
npm ERR! node_modules/@angular/material-moment-adapter
npm ERR! @angular/material-moment-adapter@\"*\" 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\\xxx\\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\\xxxx\\AppData\\Local\\npm-cache\\_logs\\2022-08-11T06_40_07_646Z-debug-0.log
我尝试运行 npm install 和 npm i moment 并没有工作。
(其他的“重复问题”不是同一种情况)
这是包json:
{ \"name\": \"证书盲人\", \"版本\": \"0.0.0\", \“脚本\”:{ \"ng\": \"ng\", \"开始\": \"ng服务\", \"build\": \"ng build\", \"测试\": \"ng 测试\", \"lint\": \"ng lint\", \"e2e\": \"ng e2e\", \"格式\": \"更漂亮 --write \"src//*.{ts,html,scss,json}\" \"!src//迁移/**/.\" }, “私人”:是的, \"依赖\": { \"@angular/animations\": \"~10.1.6\", \"@angular/cdk\": \"^10.2.7\", \"@angular/common\": \"~10.1.6\", \"@angular/compiler\": \"~10.1.6\", \"@angular/core\": \"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0\", \"@angular/forms\": \"~10.1.6\", \"@angular/material\": \"^10.2.7\", \"@angular/platform-browser\": \"~10.1.6\", \"@angular/platform-browser-dynamic\": \"~10.1.6\", \"@angular/路由器\": \"~10.1.6\", \"@binssoft/ngx-captcha\": \"^1.0.0\", \"@types/lodash\": \"^4.14.162\", \"cors\": \"^2.8.5\", \"文件保护程序\": \"^2.0.5\", \"扁平化\": \"^3.2.4\", \"lodash\": \"^4.17.20\", \"mat-file-upload\": \"^11.1.2\", \"ng-recaptcha\": \"^8.0.1\", \"ngx-bootstrap\": \"^6.2.0\", \"更漂亮\": \"^2.1.2\", \"rxjs\": \"~6.6.0\", \"tslib\": \"^2.0.0\", \"zone.js\": \"~0.10.2\" }, \"devDependencies\": { \"@angular-devkit/build-angular\": \"~0.1001.7\", \"@angular/cli\": \"^10.2.3\", \"@angular/compiler-cli\": \"~10.1.6\", \"@types/file-saver\": \"^2.0.1\", \"@types/jasmine\": \"~3.5.0\", \"@types/jasminewd2\": \"~2.0.3\", \"@types/node\": \"^12.11.1\", \"codelyzer\": \"^6.0.0\", \"茉莉花核\": \"~3.6.0\", \"jasmine-spec-reporter\": \"~5.0.0\", \"量角器\": \"~7.0.0\", \"ts-node\": \"~8.3.0\", \"tslint\": \"~6.1.0\", \"打字稿\": \"~4.0.2\" }, \"peerDependencies\": { \"@angular/core\": \"^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0\" } }
.
-
似乎对等依赖项导致了问题,请尝试执行
npm install moment --force,如果可行,那么您必须注意哪个对等依赖项失败了\' -
有几个错误,这是第一个:peerOptional @angular/animations@\"14.1.1\" from @angular/platform-browser@14.1.1
-
谁能帮忙??
标签: angular installation angular-material package compatibility