shaka-project / express-chocolatey-server

Simple Chocolatey package server for Express
5 stars 5 forks source link

admn-zip error #6

Open tgotowik opened 5 months ago

tgotowik commented 5 months ago

Steps to Reproduce

  1. download release and unzip
  2. cd into project folder
  3. install: npm i express-chocolatey-server
  4. install dependencies: npm i express adm-zip xml-escape xmldoc
  5. run simple server command: PORT=8000 npx express-chocolatey-server *.nupkg
~/express-chocolatey-server-1.0.3 # PORT=8000 npx express-chocolatey-server *.nupkg
/root/express-chocolatey-server-1.0.3/node_modules/adm-zip/adm-zip.js:57
            throw new Error(Utils.Errors.INVALID_FILENAME);
                  ^

Error: Invalid filename
    at new module.exports (/root/express-chocolatey-server-1.0.3/node_modules/adm-zip/adm-zip.js:57:19)
    at Object.readPackageMetadata (/root/express-chocolatey-server-1.0.3/chocolatey-server.js:27:21)
    at /root/express-chocolatey-server-1.0.3/cli.js:34:29
    at Array.map (<anonymous>)
    at /root/express-chocolatey-server-1.0.3/cli.js:33:62
    at Object.<anonymous> (/root/express-chocolatey-server-1.0.3/cli.js:47:3)
    at Module._compile (node:internal/modules/cjs/loader:1369:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1427:10)
    at Module.load (node:internal/modules/cjs/loader:1206:32)
    at Module._load (node:internal/modules/cjs/loader:1022:12)

Node.js v20.12.2

Expected Behaviour Standalone Server should come up.

joeyparrish commented 5 months ago

I believe if *.nupkg doesn't expand to anything in your shell, you would get this error.

Do you have any nupkg files there?

Are you running the command in bash or some other shell that expands globs?

bbrendon commented 2 months ago

I got that error as well when trying to dockerize. Solution was to add bash. CMD ["bash","-c", "npx -y express-chocolatey-server /packages/*.nupkg"]

Why did that fix it? I have no idea. I got the suggestion from a stack overflow link.

I also didn't do any npm commands ahead of time. just npx.