<!-- Thank you for reporting a possible bug in Node.js. Please fill in as much of the template below as you can. Version: output of `node -v` Platform: output of `uname -a` (UNIX), or version and 32 or 64-bit (Windows) Subsystem: if known, please specify the affected core module name If possible, please provide code that demonstrates the problem, keeping it as simple and free of external dependencies as you can. --> * **Version**: v10.15.0 * **Platform**: Linux dbiro 4.20.0-arch1-1-ARCH #1 SMP PREEMPT Mon Dec 24 03:00:40 UTC 2018 x86_64 GNU/Linux * **Subsystem**: filesystem <!-- Please provide more details below this comment. --> Details: electron-userland/electron-webpack#255 In short: Here it is the implementation of getOptions: ```javascript function getOptions(options, defaultOptions) { if (options === null || options === undefined || typeof options === 'function') { return defaultOptions; } if (typeof options === 'string') { defaultOptions = util._extend({}, defaultOptions); defaultOptions.encoding = options; options = defaultOptions; } else if (typeof options !== 'object') { throw new ERR_INVALID_ARG_TYPE('options', ['string', 'Object'], options); } if (options.encoding !== 'buffer') assertEncoding(options.encoding); return options; } ``` But this code is working: ```javascript const fsp = require('fs') fsp.readFile(SOME_VALID_URL, { encoding: 'utf8' }) ```
Details:
electron-userland/electron-webpack#255
In short:
Here it is the implementation of getOptions:
But this code is working: