webpack: Cannot read property 'match' of undefined : <p>I have installed webpack (Symfony encore) using npm as follows:</p>

<p><code>sudo npm install -g @symfony/webpack-encore --save-dev</code></p>

<p>I ran this from <code>/var/www/project</code> </p>

<p>I was required to install globally due to issues with package managers and shared folders when dealing with Windows host / Linux guest.</p>

<p>I cannot install webpack (node_modules) in the same directory (or under it) as the <code>/var/www/project</code> </p>

<p>So my package.json file looks like this:</p>

<pre><code>{
  "name": "test",
    "version": "1.0.0",
  "description": "This is a test",
  "main": "index.js",
  "dependencies": {},
  "devDependencies": {
    "@symfony/webpack-encore": "^0.15.0"
  },
  "scripts": {
    "test": "echo \"Error: no test specified\" &amp;&amp; exit 1"
  },
  "author": "Alex",
    "license": "MIT"
}
</code></pre>

<p>I run encore from <code>/var/www/project</code> using this</p>

<p><code>/usr/local/bin/encore dev</code></p>

<p>I get this lovely output in return:</p>

<pre><code>Running webpack ...

  TypeError: Cannot read property 'match' of undefined

  - index.js:125 parse
    [lib]/[webpack-encore]/[yargs-parser]/index.js:125:12

  - index.js:761 Function.Parser.detailed
    [lib]/[webpack-encore]/[yargs-parser]/index.js:761:10

  - yargs.js:938 Object.Yargs.self._parseArgs
    [lib]/[webpack-encore]/[yargs]/yargs.js:938:27

  - yargs.js:927 Object.get [as argv]
    [lib]/[webpack-encore]/[yargs]/yargs.js:927:19

  - index.js:725 Object.configureRuntimeEnvironment
    [lib]/[@symfony]/webpack-encore/index.js:725:54

  - index.js:770 Proxy.parameters
    [lib]/[@symfony]/webpack-encore/index.js:770:45

  - webpack.config.js:3 Object.&lt;anonymous&gt;
    /var/www/project/webpack.config.js:3:8

  - module.js:573 Module._compile
    module.js:573:30

  - module.js:584 Object.Module._extensions..js
    module.js:584:10

  - module.js:507 Module.load
    module.js:507:32
</code></pre>

<p>What am I missing?</p>
