node-fetch: The requested module does not provide an export named 'PassThrough'
Calling fetch gives me the following error
node_modules/node-fetch/lib/index.mjs:1
import Stream, { PassThrough } from 'stream';
^^^^^^^^^^^
SyntaxError: The requested module does not provide an export named 'PassThrough'
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 14
- Comments: 15
Commits related to this issue
- Downgrade node-fetch. Fixes `--experimental-modules` tests for Node.js < v10.2.0. See https://github.com/bitinn/node-fetch/issues/502. — committed to jaydenseric/graphql-api-koa by jaydenseric 6 years ago
The published ESM in
lib/index.mjscontains this line:Turns out,
PassThroughis not a named export ofstreamin Node.js v8, but it is in v10:In Node.js v8.12.0:
In Node.js v10.11.0: