2

I'm trying to convert my nodeJS project (command line program) into one EXE file, so I can transfer it to other computers and launch. In order to make it real I use pkg (https://github.com/zeit/pkg).

My project should work like: start command line -> output a question for user -> user types an answer -> program does some stuff and outputs results in the command line.

When I try to launch it via "node command.js start" - everything works fine on my computer. When I try to use "pkg command.js" - command-win.exe is created, but if I launch it on my computer via command line nothing happens: enter image description here

Where I made a mistake? What I missed?

And what additional information do you need for help me?

Remark: other computers which I want to start this program on, won't have any nodeJS and other installations. I need just an EXE file that starts command line and executes my program.

Ivan Burzakovskyi
  • 693
  • 1
  • 8
  • 25
  • 1
    try electron.js – DedaDev Oct 31 '18 at 15:14
  • Possible duplicate of [How to make exe files from a node.js app?](https://stackoverflow.com/questions/8173232/how-to-make-exe-files-from-a-node-js-app) – Liam Oct 31 '18 at 15:22
  • Try using nexe - https://github.com/nexe/nexe – xan_z Oct 31 '18 at 15:23
  • Note: [*Most will require you to keep the batch file as main executable, and then **bundle node.exe and your scripts**.*](https://stackoverflow.com/a/8176614/542251) Javascript is not a compiled language. So you can't really "make an exe" as exes require the ability to run machine code, which node/javascript cannot (directly) do. Node is essentially just a port of the Chrome Javascript engine designed to run outside of a browser – Liam Oct 31 '18 at 15:23
  • I've tried nexe before pkg, but there was an issue too. Nexe didn't want to include any modules I've used in the project. – Ivan Burzakovskyi Oct 31 '18 at 15:27

1 Answers1

0

I made an idiotic mistake... I forgot to type needed command after "command-win.exe". Now everything works fine.

Ivan Burzakovskyi
  • 693
  • 1
  • 8
  • 25