I run PKG on Windows 7.
I have installed Appium via npm and want to make an EXE from it.
The Appium folder contains a file package.json.
The Appium node_modules folder has 284 MB on disk.
I run
pkg PathToMyAppiumFolder
and I get the output
C:\Users\John>pkg c:\Users\John\AppData\Roaming\npm\node_modulesappium
[email protected]
Targets not specified. Assuming:
node8-linux-x86, node8-macos-x86, node8-win-x86
Fetching base Node.js binaries to PKG_CACHE_PATH
fetched-v8.9.0-linux-x86 [====================] 100%
fetched-v8.9.0-win-x86 [====================] 100%
fetched-v8.9.0-macos-x86 [====================] 100%
ERROR 1:
The application does not say me into which folder the output files are written.
This is a sever bug. I have to search the files on my disk.
I finally found them far away from my npm folder in
c:\Users\John.pkg-cache\v2.5\
ERROR 2:
The files have no extension.
It should be
fetched-v8.9.0-win-x86.exe
instead of
fetched-v8.9.0-win-x86
ERROR 3:
The compressed file has only 18MB.
It is impossible that 320 MB on disk have been packed into such a tiny file.
When I ZIP the Appium folder I get 130MB
ERROR 4:
When I run the fetched-v8.9.0-win-x86.exe it shows a command prompt and nothing more.
No Appium server is running.
Sounds like you haven't read the "Usage" section of README.md. I'd suggest checking there (particularly in the "config" section), as it should solve your problem.
OK. I understand. Nobody cares here to fix the bugs. This is a dead project.
The files starting with "fetched" are not the exported version of your script. They're the Node.JS binaries, and they're used in the process of exporting. You should be able to find an exe file in the directory from which you ran the pkg command (assuming you didn't specify --out-dir).
I did not find any exe files. Therefore I had search on my disk and found only the "fetched" files.
It would be SOO easy to print to the shell/console where the output files have been written to. Why don't you simply do it? Something like:
"The executables have been written to C:\Programs\NodeJS\Zeit"
or something like that.
Please try the following: Install Appium
npm -g install [email protected]
This results in 105.417 files beeing added to your nodeJS folder (hundred and 5 thousand!)
They occupy 310 MB on disk.
Then run Zeit to pack this into an executable.
What is the size of the executable?
Run the executable.
Does it display "Welcome to Appium 1.72" ?
At least on Windows it did not work.
Try this command:
pkg . --target=win-x64 --out-dir=dist
It should make a folder named dist and put an exe file there. If you need to package extra files, specify them in package.json as described in the "Usage" section of this repository's Readme.
As you say: "It should"
But this is the theory.
In fact it does not.
Have you edited package.json as shown in the "Config" section of the usage page? The developers of Appium likely didn't set their package up in such a way that it will work with pkg out of the box.
Most helpful comment
Have you edited package.json as shown in the "Config" section of the usage page? The developers of Appium likely didn't set their package up in such a way that it will work with pkg out of the box.