|
"node_modules/react-sortable-tree": {
"version": "2.8.0",
"resolved": "https://registry.npmjs.org/react-sortable-tree/-/react-sortable-tree-2.8.0.tgz",
"integrity": "sha512-gTjwxRNt7z0FC76KeNTnGqx1qUSlV3N78mMPRushBpSUXzZYhiFNsWHUIruyPnaAbw4SA7LgpItV7VieAuwDpw==",
"dev": true,
"dependencies": {
"frontend-collective-react-dnd-scrollzone": "^1.0.2",
"lodash.isequal": "^4.5.0",
"prop-types": "^15.6.1",
"react-dnd": "^11.1.3",
"react-dnd-html5-backend": "^11.1.3",
"react-lifecycles-compat": "^3.0.4",
"react-virtualized": "^9.21.2"
},
"peerDependencies": {
"react": "^16.3.0",
"react-dnd": "^7.3.0",
"react-dom": "^16.3.0"
}
}
dependencies 里面是
"react-dnd": "^11.1.3",
peerDependencies 里面是
"react-dnd": "^7.3.0",
什么原因会导致这种情况呢?
npm install 时,会报错,说^7.3.0 找不到,因为已经有了^11.*.*的版本。这让我只能用 --legacy-peer-deps 来避免这个 react-dnd 包的版本问题。
因为这货自己的 package.json 就已经是这样的了https://github.com/frontend-collective/react-sortable-tree/blob/master/package.json#L71-L78相关 issuehttps://github.com/frontend-collective/react-sortable-tree/issues/683
npm 升级 v7 以后自动 install peer deps,很多老项目懒得更新 peer deps (因为 v4-v6 只有 warning )的就会出这个毛病。
|
|