Open
Description
Env:
- Debian Buster
- latest nvm
- latest yarn
- node v15
- latest ipfs-core
I try to use js-ipfs while testing with NodeJS.
As a dependency of ipfs-core, ipfs-utils is installed (dev dependency)
https://github.com/ipfs/js-ipfs-utils/blob/master/src/http/fetch.js
This code check whether or not XMLHttpRequest is available in node and redirect to fetch.browser when available.
However my environment is node and ipfs-utils crashes as fetch.browser requires the global browser fetch.
I could suggest to enhance the initial statement with the following to redirect to fetch.node
if (typeof XMLHttpRequest === 'function' && typeof fetch === 'function') {
module.exports = require('./fetch.browser')
Thanks