Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
674 views
in Technique[技术] by (71.8m points)

javascript - When installing packages with Yarn, what does "incorrect peer dependency" mean?

I've just cloned a repo, which recommends the use of Yarn to install dependencies. When I run yarn install, it seems to be okay, but it provides this warning:

yarn install v0.20.3
[1/4] ??  Resolving packages...
[2/4] ??  Fetching packages...
[3/4] ??  Linking dependencies...
warning "[email protected]" has incorrect peer dependency "node-sass@^3.4.2".
[4/4] ??  Building fresh packages...
?  Done in 77.59s.

I've looked online to find out exactly what "has incorrect peer dependency" means. But all I can find are reported issues on other repositories or questions about how to fix the problem.

Can someone explain what this means and why it is only a warning, and not an error?

Also, is it something that I should try to address or report to the community behind the repo I have just cloned?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

It is only a warning as it won't actually stop your code from running, It's just there to give you a heads up that there's something wrong with your dependencies.

Effectively, peer dependencies are a way for packages to specify, "to use me, you should also have x version of y package installed".

You should upgrade to the latest versions, see this link for more details on sass-loader dependencies


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...