title: What is @types/node package in NodeJs?
body: <p>I'm using Node v10 and I found that I have dependency issue when using a library.</p>
  <p>In the <code>ldapjs</code> library, <code>lib\url.js</code> uses <code>const url = require('url')</code> and then <code>parsedURL = new url.URL(urlStr)</code> to parse the string to URL.</p>
  <p>I get this error:</p>
  <pre><code>Unhandled Rejection (TypeError): url.URL is not a constructor
  </code></pre>
  <p>with this line of code: <code>parsedURL = new url.URL(ldapurl)</code> in my React project.</p>
  <p>However, under my environment, <code>'url'</code> actually refers to <code>node_modules\@types\node\url.d.ts</code> which doesn’t contain any <code>.URL(str)</code> method, thus the error.</p>
  <p>What is <code>@types/node</code>? Is it related TypeScript? I don't use TypeScript in my project. Can I remove it?</p>
  <p>If I run Node in the terminal, it works fine:</p>
  <pre><code>&gt; const url = require('url')
  undefined
  &gt; let purl = new url.URL(&quot;https://google.com&quot;)
  undefined
  &gt; console.log(purl)
  URL {
    href: 'https://google.com/',
    origin: 'https://google.com',
    protocol: 'https:',
    username: '',
    password: '',
    host: 'google.com',
    hostname: 'google.com',
    port: '',
    pathname: '/',
    search: '',
    searchParams: URLSearchParams {},
    hash: '' }
  </code></pre>
  <p>What is the problem?</p>