Re: Is it possible to build node package as single executable binary?

From: Miroslav Lachman <>
Date: Sat, 24 Jun 2023 21:42:44 UTC
On 23/06/2023 13:11, Hiroki Tagato wrote:
> Hi Miroslav,
> I have a WIP port of Bitwarden CLI in my forked ports repository.
> Take a look at:
> It generates a single binary executable "bw" by packaging the node 
> command and necessary node modules. I have only lightly tested the 
> package on FreeBSD 13/amd64 and it seems working.

I built it in poudriere, installed on target server but it failed to run:

# bw -h
       throw error;

mmap of data failed: Permission denied
     at process.dlopen (pkg/prelude/bootstrap.js:2255:28)
     at Object.Module._extensions..node 
     at Module.load (node:internal/modules/cjs/loader:981:32)
     at Function.Module._load (node:internal/modules/cjs/loader:822:12)
     at Module.require (node:internal/modules/cjs/loader:1005:19)
     at Module.require (pkg/prelude/bootstrap.js:1855:31)
     at require (node:internal/modules/cjs/helpers:102:18)
     at Object.<anonymous> 
     at Module._compile (pkg/prelude/bootstrap.js:1930:22)
     at Object.Module._extensions..js 
(node:internal/modules/cjs/loader:1159:10) {

Then I found it is because we have /tmp mounted with nosuid, noexec set 
for security reason.
When I remounted /tmp with exec, the bw from package runs without error.

Do you know why this packaged "bw" needs /tmp to be executable while 
"bw" installed by "npm install" works with noexec set on /tmp?

Is there a way to fix it? I really would like to keep /tmp noexec.

Kind regards
Miroslav Lachman