节点导入在错误的地方寻找npm模块的主文件
我已经发布了一个npm模块: react-bootstrap-tooltip-button
package.json
文件状态
"main": "lib/TooltipButton.js",
使用npm作为另一个项目的依赖来安装模块,但是,当我尝试像这样导入它时工作正常
import TooltipButton from 'react-bootstrap-tooltip-button'
我得到一个错误,显示节点正在错误的地方寻找主文件:
Module not found: [CaseSensitivePathsPlugin] `[...]/node_modules/react-bootstrap-tooltip-button/TooltipButton.js` does not match the corresponding path on disk - File does not exist.
为什么path中缺lesslib/
missing?
事实certificate,代码很好,但这是Webpack中的一个bug。 重新启动dev服务器解决了这个问题(只是重新编译是不够的)。
在这里find提示: 在github上创build反应应用程序的问题