node-dir
node-dir copied to clipboard
Latest release 0.1.17 breaks dependent modules
I use copy-webpack-plugin, and it started to throw errors. I have found that only node-dir npm have been updated recently to 0.1.17. Installing 0.1.16 explicitly solves the problem with copy-webpack-plugin
I use [email protected]
truffle breaks as well with
TypeError: path must be a string
at TypeError (native)
at Object.fs.stat (fs.js:830:11)
at Object.files (/opt/circleci/nodejs/v4.8.3/lib/node_modules/truffle/node_modules/node-dir/lib/paths.js:164:8)
Confirmed. I use copy-webpack-plugin@^3.0.1 as well and the node-dir@0.1.17 build brakes the plugin. Implicitly installing 0.1.16 fixed the issue.
We also had an issue in a build using copy-webpack-plugin with error message "TypeError: this is not a typed array." or "ERROR in this is not a typed array."
The issue occurs when using node version < 6. I asssume because Buffer.from introduced in b40a44a74ecd8b582643088a08dab8d10c4919f6 is not compatible with node < 6.
I guess the bug is that package json of node-dir claims compatibility with
"engines": { "node": ">= 0.10.5" },
We downgraded to [email protected] which resolved the issue for us for now.
I opened another issue prior to seeing this one. Here's my 2 cents from that other issue.
TLDR: Rollback 0.1.17 and make a 0.1.18 that matches 0.1.16, then release a 1.0.0 with breaking changes since people seem to think ^ is safe...
In the latest release published ('0.1.17': '2017-05-30T11:07:09.749Z') it seems to have broken compatibility with node.js 4.X. The module make use of Buffer.from, but this is not supported in node.js v4.
Would you be open to making a new patch release of 0.1.18 that removes reliance on Buffer.from, and perhaps is simply 0.1.16 code all over again to fix peoples builds? After this then publish a 1.0.0? The reason I suggest a 1.0.0 is because copy-webpack-plugin relies on this module as a ^ dependency, so even if you release 0.2.0 with Buffer.from it will still cause issues for many people making builds with node.js 4.X - a 1.0.0 avoids this issue and makes sense since it's not a backwards compatible change. In a 1.0.0 it would make sense to set "engines" in package.json to >=6.x too.
Obviously this is a bit of a big ask, but would be very much appreciated by many folks I think :smile:
We are using node 4.2.4 and copy-webpack-plugin version 1.1.1 and seems like copy has stopped working.Curious what can be done to unblock us atm.
Also affects transfer-webpack-plugin v 0.1.4
You can add "node-dir": "0.1.16" to your own package.json as a workaround for now at least - might only work if you use a slightly newer npm, but we're good.
I forked this project long ago and it's in use by many. I just published to npm. Works the same only better, give it a try:
https://www.npmjs.com/package/path-reader
Can confirm that path-reader was a working drop-in replacement for my project.
I like the terminology of "drop-in replacement". Going to start using that in my republish of forks. Way better than plug-n-play replacement or other cheesy variant.