twlite / youtube-sr

A dead-simple youtube metadata scraper
https://npmjs.com/package/youtube-sr
MIT License
113 stars 16 forks source link

TypeError: fetch is not a function / could not find fetch library #40

Closed twlite closed 2 years ago

twlite commented 2 years ago

This issue may occur if you are using this library with nodejs. If you are getting this error, it is because you don't have fetch api installed. You can install undici or node-fetch v2.x and youtube-sr automatically finds and uses one. If you have node-fetch installed and youtube-sr is still throwing this error, it could be due to node-fetch version 3 being installed on your project. Run npm install node-fetch@2.6.6 for example to fix this issue.

NOTE: undici is given priority over node-fetch.