Ugh, this tripped me up too. If you’re on Node 18+, fetch in nodejs *is* actually supported… but only behind a flag or in experimental mode.
Try running your script with:
`node --experimental-fetch yourfile.js`
Otherwise, yeah, node-fetch or axios are the go-tos.
Fun fact: the nodejs team is working on native fetch support, so maybe soon we won’t need workarounds!
Try running your script with:
`node --experimental-fetch yourfile.js`
Otherwise, yeah, node-fetch or axios are the go-tos.
Fun fact: the nodejs team is working on native fetch support, so maybe soon we won’t need workarounds!
