菜鸟在这里使用react。尝试克隆并运行 https://github.com/strangebnb/react-airbnb
我克隆了。运行 npm 安装。然后是 webpack 但我明白了
ERROR in ./~/react-tap-event-plugin/src/injectTapEventPlugin.js
Module not found: Error: Cannot resolve module 'react/lib/EventPluginHub' in /Users/thomas/tom/node_modules/react-tap-event-plugin/src
@ ./~/react-tap-event-plugin/src/injectTapEventPlugin.js 23:2-37
ERROR in ./~/react-tap-event-plugin/src/TapEventPlugin.js
Module not found: Error: Cannot resolve module 'react/lib/EventConstants' in /Users/thomas/tom/node_modules/react-tap-event-plugin/src
@ ./~/react-tap-event-plugin/src/TapEventPlugin.js 22:21-56
ERROR in ./~/react-tap-event-plugin/src/TapEventPlugin.js
Module not found: Error: Cannot resolve module 'react/lib/EventPluginUtils' in /Users/thomas/tom/node_modules/react-tap-event-plugin/src
@ ./~/react-tap-event-plugin/src/TapEventPlugin.js 23:23-60
ERROR in ./~/react-tap-event-plugin/src/TapEventPlugin.js
Module not found: Error: Cannot resolve module 'react/lib/EventPropagators' in /Users/thomas/tom/node_modules/react-tap-event-plugin/src
@ ./~/react-tap-event-plugin/src/TapEventPlugin.js 24:23-60
ERROR in ./~/react-tap-event-plugin/src/TapEventPlugin.js
Module not found: Error: Cannot resolve module 'react/lib/SyntheticUIEvent' in /Users/thomas/tom/node_modules/react-tap-event-plugin/src
@ ./~/react-tap-event-plugin/src/TapEventPlugin.js 25:23-60
ERROR in ./~/react-tap-event-plugin/src/TapEventPlugin.js
Module not found: Error: Cannot resolve module 'react/lib/ViewportMetrics' in /Users/thomas/tom/node_modules/react-tap-event-plugin/src
@ ./~/react-tap-event-plugin/src/TapEventPlugin.js 27:22-58
ERROR in ./~/react-portal/build/portal.js
Module not found: Error: Cannot resolve module 'react/lib/CSSPropertyOperations' in /Users/thomas/tom/node_modules/react-portal/build
@ ./~/react-portal/build/portal.js 17:29-71
我找到了https://github.com/thereactivestack/meteor-webpack/issues/21 (我看到这是最近的,阅读:昨天),在搞乱了我的packages.json,更改react,react-dom,material-ui版本号并运行npm i --save react-tap-event之后-plugin
,我只剩下“只有”1 条错误消息
ERROR in ./~/react-portal/build/portal.js
Module not found: Error: Cannot resolve module 'react/lib/CSSPropertyOperations' in /Users/thomas/react-airbnb/node_modules/react-portal/build
@ ./~/react-portal/build/portal.js 17:29-71
我是个新手,我不知道如何解决这个问题。非常欢迎任何提示。
谢谢
最佳答案
由于 React 中的更新,react-tap-event-plugin 中断
如果使用react版本^15.4.0,请将package.json中的react-tap-event-plugin更改为^2.0.0。
关于reactjs - ./~/react-tap-event-plugin/src/injectTapEventPlugin.js 中出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40670018/