Is it possible to build node package as single executable binary?
Date: Thu, 22 Jun 2023 20:44:54 UTC
Node.js / npm packages can be built in to single executable binary containing all node modules and node.js executable = everything packaged in one large executable, but by default it works for Win, Mac and Linux, not for FreeBSD. Is there somebody successfully using it on FreeBSD? I would like to build Bitwarden's CLI command "bw" https://bitwarden.com/help/cli/ It can be installed on FreeBSD by "npm install @bitwarden/cli" and it works but can easily break with Node.js upgrade, that's why I would prefer to build it as single executable as it is distributed for Win, Max and Linux (it is called "Native executable" on Bitwearden's web) Source code is on Github https://github.com/bitwarden/clients/tree/master/apps/cli But I don't know how to build only apps/cli (npm install in this subdirectory failed with missing modules and npm install in top level failed on electron install, because it tries to build everything, not only CLI bw) Info for npm pkg https://github.com/vercel/pkg I am not node / JS developer, my knowledge of building node packages with npm / npx is very limited. Any help is really appreciated. Kind regards Miroslav Lachman