title: babel command converts when run in terminal but running the script ends in error
body: <p>I've been trying to get babel core and cli to convert modern JavaScript from index.js into bundle.js.</p>
  <p>here is my simple package.json</p>
  <pre><code>{
      &quot;name&quot;: &quot;chapter19&quot;,
      &quot;version&quot;: &quot;1.0.0&quot;,
      &quot;description&quot;: &quot;&quot;,
      &quot;main&quot;: &quot;index.js&quot;,
      &quot;scripts&quot;: {
          &quot;babel&quot;: &quot;./node_modules/.bin/babel ./src/index.js -w -o ./dist/assets/bundle.js&quot;
      },
      &quot;author&quot;: &quot;&quot;,
      &quot;license&quot;: &quot;ISC&quot;,
      &quot;devDependencies&quot;: {
          &quot;@babel/cli&quot;: &quot;^7.16.7&quot;,
          &quot;@babel/core&quot;: &quot;^7.16.7&quot;,
          &quot;@babel/preset-env&quot;: &quot;^7.16.7&quot;,
          &quot;babel-loader&quot;: &quot;^8.2.3&quot;
      }
  }
  </code></pre>
  <p>now when I run <code>node_modules/.bin/babel ./src/index.js -w -o ./dist/assets/bundle.js</code> in terminal, it works fine but when I try to run &quot;npm run babel&quot; in terminal, I get the following errors. so far here is what I've tried :</p>
  <pre><code>&quot;babel&quot;: &quot;node_modules/.bin/babel src/index.js -w -o dist/assets/bundle.js&quot;
  </code></pre>
  <p>result: 'node_modules' is not recognized as an internal or external command,
  operable program or batch file.</p>
  <pre><code>&quot;babel&quot;: &quot;./node_modules/.bin/babel src/index.js -w -o dist/assets/bundle.js&quot;
  </code></pre>
  <p>result:'.' is not recognized as an internal or external command,
  operable program or batch file.</p>
  <p>I have also read <a href="https://stackoverflow.com/questions/48823855/node-modules-is-not-recognized-as-an-internal-or-external-command">this</a> issue, which is basically:</p>
  <pre><code>&quot;babel&quot;: &quot;node ./node_modules/.bin/babel src/index.js -w -o dist/assets/bundle.js&quot;
  </code></pre>
  <p>OR</p>
  <pre><code>&quot;babel&quot;: &quot;node ./node_modules/.bin/babel ./src/index.js -w -o ./dist/assets/bundle.js&quot;
  </code></pre>
  <p>and I get the following error:</p>
  <pre><code>SyntaxError: missing ) after argument list
      at Object.compileFunction (node:vm:352:18)
      at wrapSafe (node:internal/modules/cjs/loader:1031:15)
      at Module._compile (node:internal/modules/cjs/loader:1065:27)
      at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
      at Module.load (node:internal/modules/cjs/loader:981:32)
      at Function.Module._load (node:internal/modules/cjs/loader:822:12)
      at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
      at node:internal/main/run_main_module:17:47
  </code></pre>
  <p>here is my folder structure (in case if its needed)</p>
  <p><a href="https://i.stack.imgur.com/L9CKx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L9CKx.png" alt="enter image description here" /></a></p>