title: dom-parser throwing syntax error even after installed from NPM
body: <p>I am  a beginner in this tech. please guide.
  Installed <em>dom-parser</em> from <strong>NPM</strong> package.   and then when i declared below it is throwing <em>syntax</em> error.
  i know it is a very small things  but i am puzzled and do not understand where i am going wrong.
  Already executed <code>npm install dom-parser</code>.</p>
  <p>code like:</p>
  <pre><code>    const DOMParser = require('dom-parser'); 
      var domParser = new DOMParser();​​
  </code></pre>
  <p>error message below:
  <code>var domParser = new DOMParser();​​</code></p>
  <pre><code>    SyntaxError: Invalid or unexpected token
          at wrapSafe (internal/modules/cjs/loader.js:1054:16)
          at Module._compile (internal/modules/cjs/loader.js:1102:27)
          at Object.Module._extensions..js 
          (internal/modules/cjs/loader.js:1158:10)
          at Module.load (internal/modules/cjs/loader.js:986:32)
          at Function.Module._load (internal/modules/cjs/loader.js:879:14)
          at Function.executeUserEntryPoint [as runMain] 
          (internal/modules/run_main.js:71:12)
          at internal/main/run_main_module.js:17:47
          [nodemon] app crashed - waiting for file changes before starting...
  </code></pre>
  <p>Thanks,
  Jowar</p>
  <p>as requested by experts,
  code snippet below:</p>
  <p>app.js file:</p>
  <pre><code>    const express = require(&quot;express&quot;);
      const bodyParser = require(&quot;body-parser&quot;);
  const https = require(&quot;https&quot;);
  const DOMParser = require('dom-parser');
  const app = express();
  app.use(bodyParser.urlencoded({
    extended: true
  }));
  
  
  app.get(&quot;/&quot;, function(req, res) {
  
    res.sendFile(__dirname + &quot;/index.html&quot;);
  });
  
  app.post(&quot;/&quot;, function(req, res) {
  
  
    const url = &quot;https://en.wikipedia.org/w/api.php?format=json&amp;action=parse&amp;page=Anthony%20Martial&quot;;
  
    https.get(url, function(response) {
  
      https.get(url, (resp) =&gt; {
        let data = '';
  
        // A chunk of data has been recieved.
        resp.on('data', (chunk) =&gt; {
          data += chunk;
        });
  
        // The whole response has been received. Print out the result.
        resp.on('end', () =&gt; {
          const jsonDATA = JSON.parse(data).parse;
          var jsonText = jsonDATA.text;
          var jsonTitle = jsonDATA.title;
          var jsonPageid = jsonDATA.pageid
  
          var str = JSON.stringify(jsonText);
  
  
          var domParser = new DOMParser();​​
  
  
  
          res.write(&quot;&lt;p&gt;player title is &quot; + jsonTitle + &quot; degree C&lt;/p&gt;&quot;);
          res.write(&quot;&lt;p&gt;The pageid is &quot; + jsonPageid + &quot;&lt;/p&gt;&quot;);
          res.write(&quot;&lt;p&gt;The pagetext is is &quot; + str + &quot;&lt;/p&gt;&quot;);
          res.send();
  
        });
      });
    });
  });
  
  
  
  app.listen(3000, function(req, res) {
    console.log(&quot;server is running in port 3000&quot;);
  });
  </code></pre>
  <p>index.html file:
  remember input field of index.html do not have any  connaction with  js file. this are just for test purpose.</p>
  <pre><code>    &lt;!DOCTYPE html&gt;
  &lt;html lang=&quot;en&quot; dir=&quot;ltr&quot;&gt;
  
  &lt;head&gt;
    &lt;meta charset=&quot;utf-8&quot;&gt;
    &lt;title&gt;weatehr App API&lt;/title&gt;
  
    &lt;!-- &lt;script src=&quot;app.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt; --&gt;
  
    &lt;link rel=&quot;stylesheet&quot; href=&quot;css/style1.css&quot;&gt;
    &lt;link rel=&quot;stylesheet&quot; href=&quot;css/style2.css&quot;&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  
    &lt;form action=&quot;/&quot; method=&quot;post&quot;&gt;
      &lt;label for=&quot;cityInput&quot;&gt;City Name:&lt;/label&gt;
      &lt;input id=&quot;cityInput&quot; type=&quot;text&quot; name=&quot;cityName&quot;&gt;
      &lt;button type=&quot;submit&quot;&gt; Go &lt;/button&gt;
      &lt;h3&gt;hello&lt;/h3&gt;
    &lt;/form&gt;
  
    &lt;script src=&quot;https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js&quot;&gt;&lt;/script&gt;
  
  
   &lt;script src=&quot;https://code.jquery.com/jquery-3.5.1.slim.min.js&quot; integrity=&quot;sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj&quot; crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js&quot; integrity=&quot;sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo&quot;    crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js&quot; integrity=&quot;sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI&quot;  crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
    &lt;script src=&quot;app.js&quot; charset=&quot;utf-8&quot;&gt;&lt;/script&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  <p>JSon file:  installed pakage.</p>
  <pre><code>{
    &quot;name&quot;: &quot;callwikiapi-2&quot;,
    &quot;version&quot;: &quot;1.0.0&quot;,
    &quot;description&quot;: &quot;&quot;,
    &quot;main&quot;: &quot;app.js&quot;,
    &quot;scripts&quot;: {
      &quot;test&quot;: &quot;echo \&quot;Error: no test specified\&quot; &amp;&amp; exit 1&quot;
    },
    &quot;author&quot;: &quot;&quot;,
    &quot;license&quot;: &quot;ISC&quot;,
    &quot;dependencies&quot;: {
      &quot;body-parser&quot;: &quot;^1.19.0&quot;,
      &quot;dom-parser&quot;: &quot;^0.1.6&quot;,
      &quot;express&quot;: &quot;^4.17.1&quot;
    }
  }
  </code></pre>
  <p>same error using codesandbox also.
  please heko , where i am going wrong. is there any dependent pakage which i have to install?</p>
  <p>PFA codesandbox attached.<a href="https://i.stack.imgur.com/nFrKN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nFrKN.png" alt="codesandbox error" /></a></p>