<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Expected Behavior</h2>


<p dir="auto">npm install should work on branch <code class="notranslate">getting-started</code></p>
<h2 dir="auto">Current Behavior</h2>
<p dir="auto">npm install fails with this output:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated @semantic-release/last-release-npm@2.0.2: Use @semantic-release/npm instead
npm ERR! code ENOVERSIONS
npm ERR! No valid versions available for duplexer3

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/jeff/.npm/_logs/2018-01-06T19_19_13_553Z-debug.log"><pre class="notranslate"><code class="notranslate">npm WARN deprecated npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
npm WARN deprecated @semantic-release/last-release-npm@2.0.2: Use @semantic-release/npm instead
npm ERR! code ENOVERSIONS
npm ERR! No valid versions available for duplexer3

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/jeff/.npm/_logs/2018-01-06T19_19_13_553Z-debug.log
</code></pre></div>
<h2 dir="auto">Steps to Reproduce (for bugs)</h2>


<ol dir="auto">
<li>git clone </li>
<li>git checkout getting-started</li>
<li>npm install</li>
</ol>
<h2 dir="auto">Environment</h2>

<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>^4.2.0</td>
</tr>
<tr>
<td>node</td>
<td>8.9.3</td>
</tr>
<tr>
<td>OS</td>
<td>Manjaro GNOME 3 x64 (relatively) fresh install</td>
</tr>
<tr>
<td>browser</td>
<td>Firefox 57.0.3</td>
</tr>
<tr>
<td>etc</td>
<td>npm version 5.6.0</td>
</tr>
</tbody>
</table>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/zeit/next.js/issues?q=is%3Aissue">issues</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h2 dir="auto">Repro steps</h2>
<p dir="auto">When using an npm module that requires <code class="notranslate">regeneratorRuntime</code> (part of <code class="notranslate">babel-runtime</code>), I get an error:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="regeneratorRuntime is not defined"><pre class="notranslate"><code class="notranslate">regeneratorRuntime is not defined
</code></pre></div>
<p dir="auto">Makes sense. So I try to define it by placing this at the top of my page <code class="notranslate">.js</code> file:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="import 'babel-runtime';
import 'babel-runtime/regenerator';"><pre class="notranslate"><span class="pl-k">import</span> <span class="pl-s">'babel-runtime'</span><span class="pl-kos">;</span>
<span class="pl-k">import</span> <span class="pl-s">'babel-runtime/regenerator'</span><span class="pl-kos">;</span></pre></div>
<p dir="auto">But the error persists. It seems like I'm not importing the runtime early enough, but I don't know where else to put it. If I move it to <code class="notranslate">_document.js</code>, the same problem occurs.</p>
<p dir="auto">Ultimately, I just want <code class="notranslate">regeneratorRuntime</code> to be defined on both client and server so I can use a library that expects it. (Many libraries exclude <code class="notranslate">regeneratorRuntime</code> from their bundles because it's oftentimes needed by several dependencies, and it's quite large.)</p>
<p dir="auto">Is there some straightforward way to do this that I'm missing?</p>
<h2 dir="auto">Your Environment</h2>
<table role="table">
<thead>
<tr>
<th>Tech</th>
<th>Version</th>
</tr>
</thead>
<tbody>
<tr>
<td>next</td>
<td>5.1.0</td>
</tr>
<tr>
<td>node</td>
<td>8.9.1</td>
</tr>
</tbody>
</table>