从 git url 依赖项中找不到模块

Fal*_*son 5 open-source node.js meteor webpack

我已经分叉了 react-flexbox-grid 来添加对隐藏列的支持(这是我第一次贡献),但我无法在我的项目中包含该包。

根据文档:Git Urls as Dependencies,我将以下内容放入我的 package.json 中:

    "react-flexbox-grid": "falieson/react-flexbox-grid#hidden-columns",
Run Code Online (Sandbox Code Playgroud)

运行 npm i 后,我看到 npm 已获取并且安装包没有错误。

???反应 dom@15.4.1 ??? react-flexbox-grid@0.10.2 (git://github.com/falieson/react-flexbox-grid.git#f8e9e9053430b619f4c7fd79b90ccd4f44d6a05c) ??? react-fontawesome@1.5.0

但是当我启动服务器时meteor:webpack 抱怨:

./imports/ui/Home/index.jsx 中的错误未找到模块:错误:无法解析 /Users/falieson/Code/planetx-boilerplate/imports/ui/Home 中的模块“react-flexbox-grid”

我没有更改 index.jsx 上的任何内容

import {Grid, Row, Col} from 'react-flexbox-grid';
Run Code Online (Sandbox Code Playgroud)

这是我的流星 webpack 配置

{
 "css": {
   "module": true
 },
 "module": {
   "loaders": [
     {
       "test": "/\\.css$/",
       "loader": "style!css?modules",
       "include": "/flexboxgrid/"
     }
   ]
 }
}
Run Code Online (Sandbox Code Playgroud)

小智 5

问题是需要构建此存储库,package.json 引用 ./lib/index.js 文件,但它不存在于存储库中(仅 src 文件夹)。

您可以使用以下命令在本地构建它:

npm run compile
Run Code Online (Sandbox Code Playgroud)

并强制添加并推送 ./lib 文件夹到您的 git 存储库。