2

I am running zip -r nm.zip node_modules and receiving this error:

zip warning: missing end signature--probably not a zip file (did you
zip warning: remember to use binary mode when you transferred it?)
zip warning: (if you are trying to read a damaged archive try -F)

node_modules is a directory. I am doing this within a docker container, within concourse.

Sheen
  • 586
  • 10
  • 22
  • 3
    That error suggests that `nm.zip` already exists, but isn't a zip file. What do you get when you run `file nm.zip`? – pmqs Apr 28 '20 at 09:21

2 Answers2

5

It means zip is expecting for a landing zip file name, provide a file name for the compressed version:

zip myfile.zip myfile
Shivkumar Mallesappa
  • 2,875
  • 7
  • 41
  • 68
Manuel Valdez
  • 66
  • 1
  • 3
2

As noted in the comment by @pmqs, this error also comes up if there is an existing file with the same name as the proposed archive name (e.g. because one of the previous processes crashed).

To fix that delete the file and re-run the zip command:

rm -vi nm.zip
zip -r nm.zip node_modules
SultanOrazbayev
  • 14,900
  • 3
  • 16
  • 46