title: How to fix `SyntaxError: Invalid or unexpected token` when trying to run Node.js app
body: <p>I have installed <a href="https://nodejs.org" rel="nofollow noreferrer">Node.js</a> from the official website.</p>
  <p>Following <a href="https://docs.microsoft.com/en-us/windows/nodejs/beginners" rel="nofollow noreferrer">these Microsoft Docs</a> I tried to create my first Node.js app with the following steps:</p>
  <ol>
  <li><p>Open PowerShell and create a new directory: <code>mkdir NodeApp</code>, then enter the directory: <code>cd NodeApp</code></p>
  </li>
  <li><p>Open the directory and your app.js file in VS Code: <code>code .</code></p>
  </li>
  <li><p>Add a simple string variable (&quot;Hello World&quot;), then send the contents of the string to your console by entering this in your &quot;app.js&quot; file:</p>
  </li>
  </ol>
  <pre class="lang-js prettyprint-override"><code>var msg = 'Hello World';
  console.log(msg);
  </code></pre>
  <ol start="4">
  <li><p>To run your &quot;app.js&quot; file with Node.js, open your terminal right inside VS Code by selecting <kbd>View</kbd> &gt; <kbd>Terminal</kbd>.</p>
  </li>
  <li><p>In the terminal, enter <code>node app.js</code>. You should see the output: &quot;Hello World&quot;.</p>
  </li>
  </ol>
  <p>After following these steps I have this console output:</p>
  <pre class="lang-sh prettyprint-override"><code>PS C:\Users\Lenovo\OneDrive\Desktop\DevFiles\NodeApp&gt; node app.js
  C:\Users\Lenovo\OneDrive\Desktop\DevFiles\NodeApp\app.js:1
  ��v
  
  
  SyntaxError: Invalid or unexpected token
      at Object.compileFunction (vm.js:344:18)
      at wrapSafe (internal/modules/cjs/loader.js:1106:15)
      at Module._compile (internal/modules/cjs/loader.js:1140:27)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
      at Module.load (internal/modules/cjs/loader.js:1040:32)
      at Function.Module._load (internal/modules/cjs/loader.js:929:14)
      at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12)
      at internal/main/run_main_module.js:17:47
  PS C:\Users\Lenovo\OneDrive\Desktop\DevFiles\NodeApp&gt; 
  </code></pre>
  <p><a href="https://i.stack.imgur.com/qtVuo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qtVuo.png" alt="enter image description here" /></a></p>
  <p>Since I'm completely new to Node.js (but not JavaScript) I'm not sure what do to. How can I fix this problem?</p>