vercel / pkg

Package your Node.js project into an executable
https://npmjs.com/pkg
MIT License
24.28k stars 1.01k forks source link

Error! Not more than one entry file/directory is expected #2022

Closed krm35 closed 8 months ago

krm35 commented 10 months ago

What version of pkg are you using?

5.8.1

What version of Node.js are you using?

v18.13.0 (Ubuntu) & 14.21.1 (Windows)

What operating system are you using?

Ubuntu 20.04 & Windows

What CPU architecture are you using?

Intel 64 bits (Ubuntu) & Amd ryzen 5 3550h (Windows)

What Node versions, OSs and CPU architectures are you building for?

node14-linux, node14-darwin, node14-linux-x64, node14-darwin-x64

Describe the Bug

Package.json file:

  "scripts": {
    "dev": "node hot-reload.js",
    "build": "pkg package.json -t node14-macos-x64,node14-linux-x64,node14-win-x64 dist/",
    "build-win32": "pkg package.json -t node14-win -o dist/win/renommez-moi-svp.exe",
    "build-linux": "pkg package.json -t node14-linux dist/linux/renommez-moi-svp.lol",
    "build-mac": "pkg package.json -t node14-darwin dist/mac/renommez-moi-svp"
  },

  "pkg": {
    "outputPath": "dist",
    "assets": [
      "node_modules/**/*",
      "build"
    ]
  }

pkg package.json -t node14-win -o dist/win/renommez-moi-svp.exe works on both linux and windows

pkg package.json -t node14-linux dist/linux/renommez-moi-svp does not work on both linux and windows Error! Not more than one entry file/directory is expected

pkg package.json -t node14-darwin dist/mac/renommez-moi-svp does not work on both linux and windows Error! Not more than one entry file/directory is expected

pkg package.json -t node14-macos-x64,node14-linux-x64,node14-win-x64 dist/ does not work on both linux and windows Error! Not more than one entry file/directory is expected

Expected Behavior

Should build

To Reproduce

Use the package.json file

krm35 commented 10 months ago

This works:

"build-linux": "pkg package.json -t node14-linux"

"build-mac": "pkg package.json -t node14-darwin"

But makes the release in the same folder with same name so one overwrites the other