npm / fstream

Advanced FS Streaming for Node
ISC License
208 stars 43 forks source link

require is not a function #63

Open ekkis opened 5 years ago

ekkis commented 5 years ago

fstream relies on graceful-fs, which itself relies on natives, the latter which is broken with the following error:

/webpack:/node_modules/natives/index.js:45
    whitelist.forEach(function (id) {
^
TypeError: require is not a function
    at /webpack:/node_modules/natives/index.js:50:1
    at Array.forEach (<anonymous>)
    at Object.req [as require] (/webpack:/node_modules/natives/index.js:45:1)
    at Object.8956 (/webpack:/node_modules/graceful-fs/fs.js:1:1)
    at __webpack_require__ (/webpack:/webpack/bootstrap:19:1)
    at Object.2242 (/webpack:/node_modules/graceful-fs/graceful-fs.js:3:1)
    at __webpack_require__ (/webpack:/webpack/bootstrap:19:1)
    at Object.7402 (/webpack:/node_modules/fstream/lib/reader.js:4:1)
    at __webpack_require__ (/webpack:/webpack/bootstrap:19:1)
    at Object.7821 (/webpack:/node_modules/fstream/fstream.js:2:1)

I've posted an issue on the graceful-fs board asking them to fix it: https://github.com/isaacs/node-graceful-fs/issues/156 but I'm wondering if this module has a good reason to be using graceful-fs or it could rely instead on the built-in (and therefore very well tested) fs, which has better sense than to use a clearly unreliable package like 'natives'