title: Node - Cross Plattform compilation - PKG
body: <p>I am currently trying to compile a node app for macos using pkg:</p>
  
  <p><a href="https://github.com/zeit/pkg" rel="nofollow noreferrer">https://github.com/zeit/pkg</a></p>
  
  <p>First of all my setup:</p>
  
  <pre><code>macos 10.14.5 (Mojave)
  node -v =&gt; v11.4.0
  npm -v =&gt; 6.4.1
  pkg -v =&gt; 4.4.0
  </code></pre>
  
  <p>My first try:</p>
  
  <pre><code>pkg index.js -t node11-mac-x64 --output dist/app-mac
  </code></pre>
  
  <p>Resulted in:</p>
  
  <pre><code>&gt; pkg@4.4.0
  &gt; Error! No available node version satisfies 'node11'
  </code></pre>
  
  <p>Thats why i switched to:</p>
  
  <pre><code>pkg index.js -t node10-mac-x64 --output dist/app-mac
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>&gt; pkg@4.4.0
  &gt; Warning
    Cannot include addon %1 into executable.
    The addon must be distributed with executable as %2.
    node_modules/sha3/build/Release/sha3.node
    path-to-executable/sha3.node
  &gt; Warning
    Cannot include addon %1 into executable.
    The addon must be distributed with executable as %2.
    node_modules/websocket/build/Release/bufferutil.node
    path-to-executable/bufferutil.node
  &gt; Warning
    Cannot include addon %1 into executable.
    The addon must be distributed with executable as %2.
    node_modules/websocket/build/Release/validation.node
    path-to-executable/validation.node
  &gt; Warning
    Failed to make bytecode node10-x64 for file /snapshot/app/node_modules/brotli/build/encode.js
  </code></pre>
  
  <p>But the executable has been generated, so i tried to run it:</p>
  
  <pre><code>./app-mac
  </code></pre>
  
  <p>Which resulted in the total disaster:</p>
  
  <pre><code>pkg/prelude/bootstrap.js:1185
        throw error;
        ^
  
  Error: File '/**/app/node_modules/linebreak/src/classes.trie' was not included into executable at compilation stage. Please recompile adding it as asset or script.
      at error_ENOENT (pkg/prelude/bootstrap.js:429:17)
      at readFileFromSnapshot (pkg/prelude/bootstrap.js:657:29)
      at Object.fs.readFileSync (pkg/prelude/bootstrap.js:700:18)
      at Object.&lt;anonymous&gt; (/snapshot/app/node_modules/linebreak/src/linebreaker.js:15:32)
      at Object.&lt;anonymous&gt; (/snapshot/app/node_modules/linebreak/src/linebreaker.js:161:4)
      at Module._compile (pkg/prelude/bootstrap.js:1261:22)
      at Object.Module._extensions..js (internal/modules/cjs/loader.js:710:10)
      at Module.load (internal/modules/cjs/loader.js:598:32)
      at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
      at Function.Module._load (internal/modules/cjs/loader.js:529:3)
  </code></pre>
  
  <p>I already read every single issue on github related to <em>pkg</em> and tried various configurations, but none of them helped...</p>
  
  <p>Can anybody please help?
  Trying to solve this issue for days now..</p>
  
  <p>Thanks and greetings!</p>
  
  <p>Is there no way i can package my application?</p>
  
  <p><strong>Update: In github they say, i have to include the .node files in the build process... but how do i do that?</strong></p>