我有一个使用ClojureScript的shadow-cljs项目。在这个项目中,我使用的是NPM包@material-ui,它工作得很好。
现在我想使用反应-可滑动-视图。为此,我扩展了我的package.json
"dependencies": {
"@material-ui/core": "^4.5.2",
"@material-ui/icons": "^4.5.1",
"highlight.js": "9.15.10",
"react": "^16.11.0",
"react-dom": "^16.11.0",
"react-flip-move": "3.0.3",
"react-highlight.js": "1.0.7",
"react-swipeable-views": "0.13.3"
}当我试图要求["react-swipeable-views" :as sv]时,我从影子cljs获得了这个错误:
所需的JS依赖项"dom-helpers/transition/properties“不可用,这是"node_modules/react-swipeable-views/lib/SwipeableViews.js".所要求的。
事实上,在transition中没有node_modules/dom-helpers/目录。但import transitionInfo from 'dom-helpers/transition/properties';在node_modules/react-swipeable-views/src/SwipeableViews.js中存在。
它看起来像是react-swipeable-views中的依赖bug,但我是NPM的新手。
有什么建议吗?或者如何调试?
更新
它连接react-swipeable-views依赖于过时的dom-helpers@3.4.0,而shadow-cljs使用当前的dom-helpers@5.1.3。请参阅https://github.com/oliviertassinari/react-swipeable-views/issues/542
两者都能用吗?还是我要等到有人修复react-swipeable-views
发布于 2019-11-09 09:51:54
您正确地识别了这是由版本冲突引起的。
不可能同时使用两个版本,必须解决此版本冲突。您可以尝试将旧的dom-helpers版本作为默认安装,方法是将它添加到package.json中,并将其添加到npm install中。也许使用新图书馆的图书馆还能和旧图书馆一起工作?
https://stackoverflow.com/questions/58734327
复制相似问题