如何使用react-swipeable-views解决shadow-cljs的NPM依赖问题?

我有一个使用shadow-cljs的ClojureScript项目。在此项目中,我使用的NPM软件包@material-ui可以正常工作。

现在,我想使用react-swipeable-views。因此,我扩展了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]时,我从shadow-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中的依赖项错误,但我是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以后?

ief111111 回答:如何使用react-swipeable-views解决shadow-cljs的NPM依赖问题?

您正确地确定这是由版本冲突引起的。

不可能同时使用两个版本,必须解决此版本冲突。您可以尝试将较旧的dom-helpers版本安装为默认版本,方法是将其添加到package.jsonnpm install中。也许正在使用较新版本的库仍可以与旧版本一起使用?

本文链接:https://www.f2er.com/3150610.html

大家都在问