Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

npm install出现WARING

运行npm install 出现下图的错误,请问大神怎么解?
2.png
需要两种不同版本的webpack


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

1 Answer

0 votes
by (71.8m points)

假如 project-main 依赖的 package-a 的 package.json 中声明了 peerDependency 是 package-apeer@^1.0.0,而 project-main 中没有任何 package-apeer 的配置,此时在 project-main 下使用 npm 执行 npm install,控制台就会告警,意思就是说使用到 package-a 的项目必须安装同时安装 package-apeer@^1.0.0 ,否则程序就可能会有异常。
这里你需要单独安装一下webpack的依赖就不会抛出warning了。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...