title: Laravel Mix: Update a Node.js dependency
body: <p>I am trying to compile webpack configuration files with Laravel Mix.</p>
  
  <p>Following webpack episode on Laracasts Vue 2 series,</p>
  
  <pre><code>// Scripts
  
    "scripts": {
      "dev": "node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
    },
  ....
  
  // mix
  mix.js('resources/assets/js/app.js', 'public/js')
  .sass('resources/assets/sass/app.scss', 'public/css')
  .version();
  </code></pre>
  
  <p>When I run $ npm run dev, I get an error:</p>
  
  <pre><code>npm ERR! Exit status 1
  
  npm ERR! Failed at the @ dev script 'node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js'.
  
  // Running
  
  npm ERR! node v4.4.5
  npm ERR! npm v2.15.5
  
  // The error points to
  let extractPlugin = new plugins.ExtractTextPlugin(
  /Users/User/Code/project/node_modules/laravel-mix/setup/webpack.config.js:126
  </code></pre>
  
  <p>The issue seems to be update a Node.js dependency: <a href="https://github.com/JeffreyWay/laravel-mix/issues/264" rel="noreferrer">https://github.com/JeffreyWay/laravel-mix/issues/264</a></p>
  
  <p>How do I update the Node.js dependency?</p>
  
  <p>I am trying:</p>
  
  <pre><code>$ brew upgrade node : Error = node not installed
  $ node -v = 2.15.5
  $ npm -v = 4.4.5
  $ brew install node // installs but throws error
  
  Error: The `brew link` step did not complete successfully
  The formula built, but is not symlinked into /usr/local
  Could not symlink bin/node
  Target /usr/local/bin/node
  already exists. You may want to remove it:
    rm '/usr/local/bin/node'
  
  To force the link and overwrite all conflicting files:
    brew link --overwrite node
  
  To list all files that would be deleted:
    brew link --overwrite --dry-run node
  
  Possible conflicting files are:
  /usr/local/bin/node
  ...
  
  **$ brew upgrade node // says node 7.5.0 already installed**
  $ npm run dev // same error
  $ node -v = 4.4.5
  </code></pre>
  
  <p>I also ran $ brew install node which installed, but I got an error:</p>
  
  <blockquote>
    <p>Error: The <code>brew link</code> step did not complete successfully. <br/>
    The formula built, but is not symlinked into /usr/local. <br/>
    Could not symlink bin/node. <br/>
    Target /usr/local/bin/node <br/>
    already exists. You may want to remove it: <br/>
    <code>rm '/usr/local/bin/node'</code></p>
  </blockquote>
  
  <p>To force the link and overwrite all conflicting files:</p>
  
  <pre><code>brew link --overwrite node
  </code></pre>
  
  <p>To list all files that would be deleted:</p>
  
  <pre><code>brew link --overwrite --dry-run node
  </code></pre>