title: how can i use native fetch with node in typescript (node v17.6)
body: <p>In the console, when running <code>node --experimental-fetch</code> the <code>fetch</code> command is now natively enabled (node version &gt;=17.6). see below</p>
  <p><a href="https://i.stack.imgur.com/01hAC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/01hAC.png" alt="native fetch with node" /></a></p>
  <p>However, when I add a typescript layer, I always get <code>error TS2304: Cannot find name 'fetch'</code>.</p>
  <p>how can I solve this?</p>
  <p>background idea: use fetch natively and get rid of <code>node-fetch</code> and <code>@types/node-fetch</code> dependencies</p>
  <p><code>tsconfig.json</code> and general setup: <a href="https://github.com/nexys-system/server-boilerplate/blob/master/tsconfig.json" rel="nofollow noreferrer">https://github.com/nexys-system/server-boilerplate/blob/master/tsconfig.json</a></p>
  <p>see also:</p>
  <ul>
  <li><a href="https://news.ycombinator.com/item?id=30161626" rel="nofollow noreferrer">
  Fetch API has landed into Node.js</a></li>
  <li><a href="https://fusebit.io/blog/node-fetch" rel="nofollow noreferrer">fetch() In Node.js Core: Why You Should Care</a></li>
  </ul>