0

I'm trying to do

yauzl.open(path, options, (err, zipfile) => {
    //code
})

when zipfile is supposed to be of type ZipFile

On one computer everything is fine, on the other one I keep getting undefined.

The only differences between the too is that I downloaded the yauzl module using npm install yauzl then copied the node_modules folder + the package.json & package-lock.json to the second computer (it's offline so I cant directly install onto it)

It never did any problems up until now, and when I tried copying the entire project back to the first computer from the second computer it works!

Any idea?

Pictures for references:

On the first computer (working one): enter image description here

On the second computer (not working one): enter image description here

PS The null on this picture is the options object and zipfile still shows up as undefined even with something in it.

4

1 回答 1

0

好吧,我使用的 zip 文件显然已损坏且为空,这使得 ZipFile 返回未定义。

我花了太长时间才意识到这一点。

于 2021-03-02T15:08:50.643 回答