title: Install npm package from git/github - Module not found: Error: Can't resolve 'dom-helpers/class'
body: <p>I am trying to install <code>React.js</code> package via git/github.</p>
  
  <p>Package installation directly via npm works. Unfortunately <a href="https://github.com/react-bootstrap/dom-helpers" rel="noreferrer">react-bootstrap/dom-helpers</a> has a <a href="https://github.com/react-bootstrap/dom-helpers/pull/20" rel="noreferrer">bug</a> and repository owner/creator is reluctant to merge fix.</p>
  
  <p>So I created my own <a href="https://github.com/GovPredict/dom-helpers" rel="noreferrer">repo</a> and applied manually fix. Then I wanted to install it via git/github (quicker than creating npm package and distributing it - I don't know how to do this).</p>
  
  <p>So I added line to my <code>package.json</code>:</p>
  
  <pre><code>  "dependencies": {
      [...]
      "dom-helpers": "git://github.com/GovPredict/dom-helpers.git",
  </code></pre>
  
  <p>Then I found that this repo has pretty poor <code>package.json</code> (it doesn't ues <code>files</code> option etc) and when you install it via <code>git</code> and then check path</p>
  
  <pre><code>./node_modules/dom-helpers/
  </code></pre>
  
  <p>you find directory without source code (only files included by default: <code>LICENSE</code>, <code>README.md</code> are present).</p>
  
  <p>I made some changes and right it almost works...</p>
  
  <p>I say almost, because it looks like <code>webpack</code> doesn't load repo OR... <code>package.json</code> still has errors.</p>
  
  <p>When I run webpack development then I have</p>
  
  <pre><code>ERROR in ../~/react-big-calendar/lib/Agenda.js
  Module not found: Error: Can't resolve 'dom-helpers/class' in '/Users/maciejkowalski/projects/SomeProject/node_modules/react-big-calendar/lib'
  resolve 'dom-helpers/class' in '/Users/maciejkowalski/projects/SomeProject/node_modules/react-big-calendar/lib'
    Parsed request is a module
    using description file: /Users/maciejkowalski/projects/SomeProject/node_modules/react-big-calendar/package.json (relative path: ./lib)
      Field 'browser' doesn't contain a valid alias configuration
    after using description file: /Users/maciejkowalski/projects/SomeProject/node_modules/react-big-calendar/package.json (relative path: ./lib)
      resolve as module
        /Users/maciejkowalski/projects/SomeProject/node_modules/react-big-calendar/lib/node_modules doesn't exist or is not a directory
        /Users/maciejkowalski/projects/SomeProject/node_modules/react-big-calendar/node_modules doesn't exist or is not a directory
        /Users/maciejkowalski/projects/SomeProject/node_modules/node_modules doesn't exist or is not a directory
        /Users/maciejkowalski/projects/GovPredict/node_modules doesn't exist or is not a directory
        /Users/maciejkowalski/projects/node_modules doesn't exist or is not a directory
        /Users/maciejkowalski/node_modules doesn't exist or is not a directory
        /Users/node_modules doesn't exist or is not a directory
        /node_modules doesn't exist or is not a directory
        looking for modules in /Users/maciejkowalski/projects/SomeProject/front
          using description file: /Users/maciejkowalski/projects/SomeProject/package.json (relative path: ./front)
            Field 'browser' doesn't contain a valid alias configuration
          after using description file: /Users/maciejkowalski/projects/SomeProject/package.json (relative path: ./front)
            using description file: /Users/maciejkowalski/projects/SomeProject/package.json (relative path: ./front/dom-helpers/class)
              as directory
                /Users/maciejkowalski/projects/SomeProject/front/dom-helpers/class doesn't exist
              no extension
                Field 'browser' doesn't contain a valid alias configuration
                /Users/maciejkowalski/projects/SomeProject/front/dom-helpers/class doesn't exist
              .js
                Field 'browser' doesn't contain a valid alias configuration
                /Users/maciejkowalski/projects/SomeProject/front/dom-helpers/class.js doesn't exist
              .jsx
                Field 'browser' doesn't contain a valid alias configuration
                /Users/maciejkowalski/projects/SomeProject/front/dom-helpers/class.jsx doesn't exist
              .json
                Field 'browser' doesn't contain a valid alias configuration
                /Users/maciejkowalski/projects/SomeProject/front/dom-helpers/class.json doesn't exist
        looking for modules in /Users/maciejkowalski/projects/SomeProject/node_modules
          using description file: /Users/maciejkowalski/projects/SomeProject/package.json (relative path: ./node_modules)
            Field 'browser' doesn't contain a valid alias configuration
          after using description file: /Users/maciejkowalski/projects/SomeProject/package.json (relative path: ./node_modules)
            using description file: /Users/maciejkowalski/projects/SomeProject/node_modules/dom-helpers/package.json (relative path: ./class)
              as directory
                /Users/maciejkowalski/projects/SomeProject/node_modules/dom-helpers/class doesn't exist
              no extension
                Field 'browser' doesn't contain a valid alias configuration
                /Users/maciejkowalski/projects/SomeProject/node_modules/dom-helpers/class doesn't exist
              .js
                Field 'browser' doesn't contain a valid alias configuration
                /Users/maciejkowalski/projects/SomeProject/node_modules/dom-helpers/class.js doesn't exist
              .jsx
                Field 'browser' doesn't contain a valid alias configuration
                /Users/maciejkowalski/projects/SomeProject/node_modules/dom-helpers/class.jsx doesn't exist
              .json
                Field 'browser' doesn't contain a valid alias configuration
                /Users/maciejkowalski/projects/SomeProject/node_modules/dom-helpers/class.json doesn't exist
  [/Users/maciejkowalski/projects/SomeProject/node_modules/react-big-calendar/lib/node_modules]
  [/Users/maciejkowalski/projects/SomeProject/node_modules/react-big-calendar/node_modules]
  [/Users/maciejkowalski/projects/SomeProject/node_modules/node_modules]
  [/Users/maciejkowalski/projects/GovPredict/node_modules]
  [/Users/maciejkowalski/projects/node_modules]
  [/Users/maciejkowalski/node_modules]
  [/Users/node_modules]
  [/node_modules]
  [/Users/maciejkowalski/projects/SomeProject/front/dom-helpers/class]
  [/Users/maciejkowalski/projects/SomeProject/front/dom-helpers/class]
  [/Users/maciejkowalski/projects/SomeProject/front/dom-helpers/class.js]
  [/Users/maciejkowalski/projects/SomeProject/front/dom-helpers/class.jsx]
  [/Users/maciejkowalski/projects/SomeProject/front/dom-helpers/class.json]
  [/Users/maciejkowalski/projects/SomeProject/node_modules/dom-helpers/class]
  [/Users/maciejkowalski/projects/SomeProject/node_modules/dom-helpers/class]
  [/Users/maciejkowalski/projects/SomeProject/node_modules/dom-helpers/class.js]
  [/Users/maciejkowalski/projects/SomeProject/node_modules/dom-helpers/class.jsx]
  [/Users/maciejkowalski/projects/SomeProject/node_modules/dom-helpers/class.json]
   @ ../~/react-big-calendar/lib/Agenda.js 9:13-41
   @ ../~/react-big-calendar/lib/Views.js
   @ ../~/react-big-calendar/lib/Calendar.js
   @ ../~/react-big-calendar/lib/index.js
   @ ./components/under-the-dome-calendar/under-the-dome-calendar.jsx
   @ ./application.js
  </code></pre>
  
  <p>As you see something wrong is with loading files (<code>webpack</code>) or with <a href="https://github.com/GovPredict/dom-helpers" rel="noreferrer">package</a>.</p>
  
  <p>How to fix it (quality matters)?</p>
  
  <hr>
  
  <p><strong>EDIT 1</strong></p>
  
  <p>It looks like when you install files via npm package (without git) then</p>
  
  <pre><code>./node_modules/dom-helpers/
  </code></pre>
  
  <p>looks like</p>
  
  <pre><code>% ls -lah
  total 56
  drwxr-xr-x  14 maciejkowalski  staff   476B  6 kwi 20:45 .
  drwxr-xr-x   8 maciejkowalski  staff   272B  6 kwi 21:39 ..
  -rw-r--r--   1 maciejkowalski  staff   4,6K  4 lut 15:08 README.md
  -rw-r--r--   1 maciejkowalski  staff   593B  4 lut 15:14 activeElement.js
  drwxr-xr-x   6 maciejkowalski  staff   204B  6 kwi 20:45 class
  drwxr-xr-x   7 maciejkowalski  staff   238B  6 kwi 20:45 events
  -rw-r--r--   1 maciejkowalski  staff   1,9K  4 lut 15:14 index.js
  -rw-r--r--   1 maciejkowalski  staff   231B  4 lut 15:14 ownerDocument.js
  -rw-r--r--   1 maciejkowalski  staff   490B  4 lut 15:14 ownerWindow.js
  -rw-r--r--   1 maciejkowalski  staff   2,5K  6 kwi 20:45 package.json
  drwxr-xr-x  16 maciejkowalski  staff   544B  6 kwi 20:45 query
  drwxr-xr-x   5 maciejkowalski  staff   170B  6 kwi 20:45 style
  drwxr-xr-x   7 maciejkowalski  staff   238B  6 kwi 20:45 transition
  drwxr-xr-x  10 maciejkowalski  staff   340B  6 kwi 20:45 util
  </code></pre>
  
  <p>However when I install my <a href="https://github.com/GovPredict/dom-helpers" rel="noreferrer">dom-helpers fork</a> via git, then I have:</p>
  
  <pre><code>% ls -lah
  total 48
  drwxr-xr-x    6 maciejkowalski  staff   204B  6 kwi 21:43 .
  drwxr-xr-x  610 maciejkowalski  staff    20K  6 kwi 21:43 ..
  -rw-r--r--    1 maciejkowalski  staff   1,1K  6 kwi 21:43 License.txt
  -rw-r--r--    1 maciejkowalski  staff   4,6K  6 kwi 21:43 README.md
  -rw-r--r--    1 maciejkowalski  staff   9,3K  6 kwi 21:43 package.json
  drwxr-xr-x   12 maciejkowalski  staff   408B  6 kwi 21:43 src
  </code></pre>
  
  <p>So something wrong is with build process.</p>
  
  <p>How to fix it?</p>