npm UNMET PEER DEPENDENCY 경고는 어떻게 수정합니까?
Node 5.6.0 및 npm 3.6.0과 함께 Windows 10을 사용하고 있습니다. angular-material과 mdi를 작업 폴더에 설치하려고합니다. npm 은 다음과 같이 각도 재료 mdi 오류를 설치 합니다.
+-- angular@1.5.0
+-- UNMET PEER DEPENDENCY angular-animate@^1.5.0
+-- UNMET PEER DEPENDENCY angular-aria@^1.5.0
+-- angular-material@1.0.6
+-- UNMET PEER DEPENDENCY angular-messages@^1.5.0 `-- mdi@1.4.57
npm WARN enoent ENOENT: no such file or directory, open
'C:\Users\xxxxx\Desktop\ngClassifieds\package.json'
npm WARN angular-material@1.0.6 requires a peer of
angular-animate@^1.5.0 but none was installed.
npm WARN angular-material@1.0.6 requires a peer of angular-aria@^1.5.0
but none was installed.
npm WARN angular-material@1.0.6 requires a peer of
angular-messages@^1.5.0 but none was installed.
AngularJS Material 및 MDI를 설치하려면이 문제를 어떻게 해결합니까?
npm은 더 이상 피어 종속성을 설치하지 않으므로 수동으로 설치하고 npm install
필요한 dep을 수행 한 다음 기본을 다시 설치하십시오.
댓글에 답장 :
그것은 그 메시지에서 옳습니다.
UNMET PEER DEPENDENCY angular-animate@^1.5.0 +--
UNMET PEER DEPENDENCY angular-aria@^1.5.0 +-- angular-material@1.0.6 +
UNMET PEER DEPENDENCY angular-messages@^1.5.0 `-- mdi@1.4.57`
그래서 당신은 npm install angular angular-animate angular-aria angular-material angular-messages mdi
UNMET PEER DEPENDENCY
package.json
파일에 지정된 하나 이상의 모듈의 종속성이 충족되지 않으면 오류가 발생합니다 . 경고를주의 깊게 확인하고 package.json
올바른 버전의 종속성으로 파일을 업데이트하십시오 .
그런 다음 실행
rm -rf node_modules/
npm cache clean
npm install
필요한 모든 종속성이 올바르게 설치됩니다.
필자의 경우 모든 종속성이 이미 존재했습니다. 이 경우 NPM 이 충돌했을 수 있으므로 업데이트하십시오 . 내 문제를 해결했습니다.
npm install -g npm
npm-install-peers 가 나를 위해 일했습니다.
npm install -g npm-install-peers
이 오류의 가장 가능한 원인 중 하나는 package.json에서 이전 버전을 정의했기 때문일 수 있습니다. 이 문제를 해결하려면 npm이 불평하는 n.와 일치하도록 package.json의 버전을 변경하십시오.
완료되면 npm install 및 voila !!를 실행하십시오.
좋아, 나는 이것을 알아 내려고 오랫동안 고투했다. 다른 모든 방법을 다 써 버린 핵 옵션 은 다음과 같습니다 .
- PC에 새 폴더를 만듭니다.
- Download a brand new installation of angular - I used this guide: https://coursetro.com/posts/code/55/How-to-Install-an-Angular-4-App
- Run it, make sure it works
- Then install your dependancies one by one from your package.json file
- Run it after each one is installed
When you are done, and it still works, import your actual code into this new project. Fix any compile errors the newer version of angular causes.
Thats what did it for me.. 1 hour of rework vs 6 hours of trying to figure out wtf was wrong.. wish i did it this way to start..
Today available Angular 2 rc.7, and I had a similar problem with rxjs@5.0.0-beta.12
UNMET PEER DEPENDENCY.
If you, like me, simply replaced @angular/...rc.6
to @angular/...rc.7
- it's not enough. Because, for example, @angular/router
has no rc.6
version.
In this case, better review package.json in Quick start
This answer doesn’t apply all cases, but if you can’t solve the error by simply typing npm install
, this steps might help.
Let`s say you got this error.
UNMET PEER DEPENDENCY packageA@4.2.0
npm WARN packageB@3.3.0 requires a peer of packageA@^3.1.0 but none was installed.
This means you installed version 4.2.0 of packageA, but packageB@3.3.0 needs version 3.x.x of pakageA. (explanation of ^)
So you can resolve this error by downgrading packageA to 3.x.x, but usually you don`t want to downgrade the package.
Good news is that in some cases, packageB is just not keeping up with packageA and maintainer of packageB is trying hard to raise the peer dependency of packageA to 4.x.x.
In that case, you can check if there is a higher version of packageB that requires version 4.2.0 of packageA in the npm or github.
For example, Go to release page
Oftentimes you can find breaking change about dependency like this.
packageB v4.0.0-beta.0
BREAKING CHANGE
package: requires packageA >= v4.0.0
If you don’t find anything on release page, go to issue page and search issue by keyword like peer
. You may find useful information.
At this point, you have two options.
1) Upgrade to the version you want
2) Leave error for the time being, wait until stable version is released.
If you choose option1:
In many cases, the version does not have latest
tag thus not stable. So you have to check what has changed in this update and make sure anything won`t break.
If you choose option2:
If upgrade of pakageA from version 3 to 4 is trivial, or if maintainer of pakageB didn’t test version 4 of pakageA yet but says it should be no problem, you may consider leaving the error.
In both case, it is best to thoroughly test if it does not break anything.
Lastly, if you wanna know why you have to manually do such a thing, this link explains well.
The given answer wont always work. If it does not fix your issue. Make sure that you are also using the correct symbol in your package.json
. This is very important to fix that headache. For example:
warning " > @angular/compiler-cli@5.2.7" has incorrect peer dependency "typescript@>=2.4.2 <2.7".
warning " > tsickle@0.25.6" has incorrect peer dependency "typescript@>=2.4.2 <2.6".
So my typescript needs to be between 2.4.2 and 2.6 right?
So I changed my typescript library from using "typescript": "^2.7"
to using "typescript": "^2.5"
. Seems correct?
Wrong.
The ^
means that you are okay with npm using "typescript": "2.5"
or "2.6"
or "2.7"
etc...
If you want to learn what the ^
and ~
it mean see: What's the difference between tilde(~) and caret(^) in package.json?
Also you have to make sure that the package exists. Maybe there is no "typescript": "2.5.9"
look up the package numbers. To be really safe just remove the ~
or the ^
if you dont want to read what they mean.
you can resolve by installing the UNMET dependencies globally.
example : npm install -g @angular/common@4.4.6
install each one by one. its worked for me.
참고URL : https://stackoverflow.com/questions/35738346/how-do-i-fix-the-npm-unmet-peer-dependency-warning
'Programing' 카테고리의 다른 글
C ++에서 <=> 연산자는 무엇입니까? (0) | 2020.05.10 |
---|---|
Context.startForegroundService ()가 Service.startForeground ()를 호출하지 않았습니다. (0) | 2020.05.10 |
TypeError : method ()는 1 개의 위치 인수를 취하지 만 2가 주어졌습니다 (0) | 2020.05.10 |
수업 종류 확인 (0) | 2020.05.10 |
푸시 알림 기술은 Android에서 어떻게 작동합니까? (0) | 2020.05.10 |