升级到反应v16后,当我使用yarn时,其他依赖项显示警告:
warning "react-chartjs-2@2.1.0" has incorrect peer dependency "react@^0.14 || ^15.0.0-rc || ^15.0".
warning "react-chartjs-2@2.1.0" has incorrect peer dependency "react-dom@^0.14 || ^15.0.0-rc || ^15.0".
warning "react-motion@0.5.0" has incorrect peer dependency "react@^0.14.9 || ^15.3.0".
warning "react-router@3.0.5" has incorrect peer dependency "react@^0.14.0 || ^15.0.0".
warning "react-router-dom@4.1.2" has incorrect peer dependency "react@^15".
warning "react-router@4.1.2" has incorrect peer dependency "react@^15".
warning "react-scrollchor@4.0.0" has unmet peer dependency "fbjs@*".
warning "react-sizes@0.1.2" has incorrect peer dependency "react@^15.6.1".
warning "react-sizes@0.1.2" has incorrect peer dependency "react-dom@^15.6.1".
warning "react-addons-test-utils@15.6.2" has incorrect peer dependency "react-dom@^15.4.2".
如何更新这些组件?我是否必须手动使用纱线为每个纱线添加最新版本?这会解决这个问题吗?顺便说一句,这些警告显然对我的应用程序没有影响,它仍然可以编译并运行。
答案 0 :(得分:1)
在终端中运行命令yarn upgrade
https://yarnpkg.com/lang/en/docs/cli/upgrade/
答案 1 :(得分:0)
您可以安装npm-check-updates并在终端中运行ncu -a
。
答案 2 :(得分:0)
npm install -g npm-check-updates命令将在package.json
中检查并安装它