title: How to make Next.js "see" the react-dom package?
body: <p>This is my first ever Next.js project, and I encountered an odd obstacle. Even though I made sure at least 3 times that I have react-dom and react installed and up-to-date, during <code>next</code>, <code>next build</code> or <code>next run</code> the process aborts with the message:</p>
  <p><code>The module 'react-dom' was not found. Next.js requires that you include it in the 'dependencies' of your 'package.json'. To add it, run 'npm install --save react-dom'</code>,</p>
  <p><code>Error: Cannot find module 'react-dom/server'</code>,</p>
  <p>and:</p>
  <p><code>Error: &gt; Build failed because of webpack errors</code>.</p>
  <p>Reading on similar problems, I did a couple of things suggested that actually fit my problem, like removing <code>node_modules</code> and doing <code>yarn</code>, reinstalling <code>react-dom</code> and <code>react</code>, but none of these helped. Deploying on Now.sh (on which I'm planning to deploy this site) also returns with an error.</p>
  <p>This is my <code>package.json</code>:</p>
  <pre class="lang-json prettyprint-override"><code>{
    &quot;dependencies&quot;: {
      &quot;next&quot;: &quot;^9.0.2&quot;,
      &quot;react&quot;: &quot;^16.8.6&quot;,
      &quot;react-dom&quot;: &quot;^16.8.6&quot;
    },
    &quot;scripts&quot;: {
      &quot;dev&quot;: &quot;next&quot;,
      &quot;build&quot;: &quot;next build&quot;,
      &quot;start&quot;: &quot;next start&quot;
    }
  }
  
  </code></pre>
  <p>I really made sure the result should be the browser opening my project on <code>localhost:3000</code>, but all of the Next.js commands that could make or lead to making this happen abort. Any ideas? Don't hesitate to ask for more code.</p>