迁移到React 16之后,我收到很多警告,说明Peer Dependency不正确。
如何用纱线避免这些?
我尝试移除所有包裹,移除了yarn.lock,然后又添加了纱线。
warning "react-textarea-autosize@4.3.2" has incorrect peer dependency "react@>=0.14.0 <16.0.0".
warning "react-modal@2.4.1" has incorrect peer dependency "react@^0.14.0 || ^15.0.0".
warning "react-modal@2.4.1" has incorrect peer dependency "react-dom@^0.14.0 || ^15.0.0".
warning "react-komposer@2.0.0" has incorrect peer dependency "react@^0.14.7 || ^15.0.0".
warning "react-treebeard@2.0.3" has incorrect peer dependency "react@^15.5.4".
warning "react-treebeard@2.0.3" has incorrect peer dependency "react-dom@^15.5.4".
warning "babel-loader@6.4.1" has unmet peer dependency "webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc".
warning "chai-enzyme@0.8.0" has unmet peer dependency "cheerio@0.19.x || 0.20.x || 0.22.x || 1.0.0-rc.1".
warning "chai-enzyme@0.8.0" has incorrect peer dependency "enzyme@1.x || ^2.3.0".
warning "chai-enzyme@0.8.0" has incorrect peer dependency "react@^0.14.0 || ^15.0.0-0".
warning "chai-enzyme@0.8.0" has incorrect peer dependency "react-dom@^0.14.0 || ^15.0.0-0".
warning "react-element-to-jsx-string@5.0.7" has incorrect peer dependency "react@^0.14.8 || ^15.0.1".
warning "dirty-chai@1.2.2" has incorrect peer dependency "chai@<1.10.0 || >1.10.0 <4".
warning "material-ui-icons@1.0.0-beta.17" has incorrect peer dependency "material-ui@^1.0.0-beta.16".
warning "react-addons-test-utils@15.6.2" has incorrect peer dependency "react-dom@^15.4.2".
warning "sass-loader@6.0.6" has unmet peer dependency "webpack@^2.0.0 || >= 3.0.0-rc.0 || ^3.0.0".
答案 0 :(得分:1)
运行&#39;纱线升级&#39;。它应该解决许多不正确的依赖项。然后你应该将其余软件包的版本更改为适当的软件包,但是期望某些软件包过时。