Module not found: Error: Can't resolve 'bundle.js' in '/Users/jonathankuhl/Documents/Programming/node js/sandbox/webpack-app' : <p>I am trying to go through a very basic tutorial about Webpack.  I cannot get it to compile a very basic single line javascript application.  I have installed and uninstalled it multiple times.</p>

<p>It's just a tutorial to learn how to use Webpack.  I used <code>npm init</code> to set up the <code>package.json</code> and did nothing else to touch that file.  I have a single index.html file and a single app.js file that is suppose to bundle into a bundle.js file.</p>

<p>I enter: <code>webpack app.js bundle.js</code> into the terminal</p>

<p>I keep getting this error:</p>

<pre><code>Jonathans-MBP:webpack-app jonathankuhl$ webpack app.js bundle.js
Hash: 8d502a6e1f30f2ad64ab
Version: webpack 4.1.1
Time: 157ms
Built at: 2018-3-20 12:25:32
 1 asset
Entrypoint main = main.js
   [0] ./app.js 18 bytes {0} [built]
   [1] multi ./app.js bundle.js 40 bytes {0} [built]

WARNING in configuration
The 'mode' option has not been set. Set 'mode' option to 'development' or 'production' to enable defaults for this environment.

ERROR in multi ./app.js bundle.js
Module not found: Error: Can't resolve 'bundle.js' in '/Users/jonathankuhl/Documents/Programming/node js/sandbox/webpack-app'
 @ multi ./app.js bundle.js
</code></pre>

<p>Here's the package.json, there's nothing in it that I didn't do outside of <code>npm init</code>:</p>

<pre><code>{
"name": "webpack-app",
  "version": "1.0.0",
  "description": "testing",
  "main": "app.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" &amp;&amp; exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "webpack": "^4.1.1"
  }
}
</code></pre>

<p>What am I doing wrong?  I'm literally doing exactly what the tutorial is telling me to do, step by step.  I don't know much about webpack, thought I should look into it, since I want a job in web development.  I don't know what it means by "can't resolve 'bundle.js'.  It's as if bundle.js doesn't exist, but it's not supposed to exist, webpack creates it.</p>

<p>I've tried alternatives such as doing <code>npm run build</code> after adding <code>"build":"webpack"</code> to my package.json under <code>"scripts"</code>, and had no luck.  That was before I deleted the entire directory and started over.  I've installed and uninstalled both webpack and webpack-cli a few times as well.</p>

<p>What am I doing wrong?</p>

<p>Here's the tut, if it matters: <a href="https://www.youtube.com/watch?v=lziuNMk_8eQ" rel="noreferrer">https://www.youtube.com/watch?v=lziuNMk_8eQ</a>  It's a little less than a year old, so maybe it's slightly outdated?</p>
