adm-zip
adm-zip copied to clipboard
Error: Can't resolve 'original-fs' (in 0.4.11)
Same as #213, reporting again because it's not fixed in 0.4.11 (latest version to date).
Getting this warning:
WARNING in ./node_modules/adm-zip/util/fileSystem.js
Module not found: Error: Can't resolve 'original-fs' in '/MY/CODE/node_modules/adm-zip/util'
in my Node.js environment just by requiring adm-zip:
require('adm-zip');
It works in adm-zip 0.4.7, apparently problem was introduced in 0.4.8. #213 has more details on the probable cause.
I had the same issue. I solved it the dirty way by adding https://github.com/LongTengDao/original-fs
npm i --save original-fs
I had the same issue. I solved it the dirty way by adding https://github.com/LongTengDao/original-fs
npm i --save original-fs
Mine stopped building after adding that. First it was warning, now it's lot of error 😆
@cthackers Any updates on this ??
We still see this warning, using 0.4.13.
@cthackers Could you solve this?
I solved it by adding original-fs in my dependencies
Can be solved without adding original-fs as a dependency for those who use Rollup. In the rollup/plugin-commonjs plugin options object add ignore: ['original-fs']
Any update on this issue ?
I just installed this module (so i got v0.5.5), and got the same warning
I'm using Webpack, should i mark original-fs as an external dependency?
edit:
Seems like the warning comes from this line : https://github.com/cthackers/adm-zip/blob/master/util/fileSystem.js#L4
And this line is meant for electron only, so it should be safe to ignore i guess.
I'd like to point out that the original-fs package has an LGPL license, which may be undesirable for some users.
If you're using webpack, it should be safe to use something like this in your webpack.config.js, which will prevent the warning from appearing:
plugins: [
new webpack.IgnorePlugin(/original-fs/, /adm-zip/)
],
For those wondering about the LGPL license mentioned above: https://github.com/cthackers/adm-zip/issues/242#issuecomment-893523408. The error is still here even in latest 0.5.6 but this only concern electron app: https://github.com/cthackers/adm-zip/blob/13979d03659c57e545e6c01275686a03cb75cb4a/util/fileSystem.js. It's probably save to ignore as suggested in other comments if not on electron.
The error still occurs in latest version (as of today) 0.5.14. Maybe there can be an electron extension or option where this is listed as a dependency and otherwise it's not?