adm-zip icon indicating copy to clipboard operation
adm-zip copied to clipboard

Error: Can't resolve 'original-fs' (in 0.4.11)

Open alexkli opened this issue 6 years ago • 9 comments

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.

alexkli avatar Jul 07 '18 00:07 alexkli

I had the same issue. I solved it the dirty way by adding https://github.com/LongTengDao/original-fs npm i --save original-fs

DanielMuller avatar Feb 14 '19 03:02 DanielMuller

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 😆

jimitpatel avatar Mar 25 '19 09:03 jimitpatel

@cthackers Any updates on this ??

ps011 avatar May 09 '19 17:05 ps011

We still see this warning, using 0.4.13.

@cthackers Could you solve this?

neknalb avatar Aug 28 '19 10:08 neknalb

I solved it by adding original-fs in my dependencies

ps011 avatar Aug 28 '19 10:08 ps011

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']

alexpopovme avatar Jul 30 '20 20:07 alexpopovme

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.

rgranger avatar Aug 05 '21 14:08 rgranger

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/)
  ],

crfrolik avatar Jan 28 '22 17:01 crfrolik

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.

Nargonath avatar Jun 20 '22 10:06 Nargonath

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?

harsh183 avatar Jun 08 '24 03:06 harsh183