Skip to content

Error compiling deasync@0.1.26 to binary with pkg@5.6.0 #170

@Drblessing

Description

@Drblessing

Hi,

OS
macOS Monterey Version 12.3.1
Apple M1 chip
npm@8.6.0

Problem
I am trying to compile the binary of a script with pkg:
pkg my-api/main.js --out-path binaries

It works until I try adding a require("deasync"); command in the main.js file. Then, the binary exits with this error.

pkg/prelude/bootstrap.js:1833
      throw error;
      ^

Error: Could not locate the bindings file. Tried:
 → /snapshot/node-js-api/node_modules/deasync/build/deasync.node
 → /snapshot/node-js-api/node_modules/deasync/build/Debug/deasync.node
 → /snapshot/node-js-api/node_modules/deasync/build/Release/deasync.node
 → /snapshot/node-js-api/node_modules/deasync/out/Debug/deasync.node
 → /snapshot/node-js-api/node_modules/deasync/Debug/deasync.node
 → /snapshot/node-js-api/node_modules/deasync/out/Release/deasync.node
 → /snapshot/node-js-api/node_modules/deasync/Release/deasync.node
 → /snapshot/node-js-api/node_modules/deasync/build/default/deasync.node
 → /snapshot/node-js-api/node_modules/deasync/compiled/16.14.2/darwin/arm64/deasync.node
 → /snapshot/node-js-api/node_modules/deasync/addon-build/release/install-root/deasync.node
 → /snapshot/node-js-api/node_modules/deasync/addon-build/debug/install-root/deasync.node
 → /snapshot/node-js-api/node_modules/deasync/addon-build/default/install-root/deasync.node
 → /snapshot/node-js-api/node_modules/deasync/lib/binding/node-v93-darwin-arm64/deasync.node
    at bindings (/snapshot/node-js-api/node_modules/bindings/bindings.js:126:9)
    at Object.<anonymous> (/snapshot/node-js-api/node_modules/deasync/index.js:30:31)
    at Module._compile (pkg/prelude/bootstrap.js:1887:22)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    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:1812:31)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/snapshot/node-js-api/my-api/main.js)
    at Module._compile (pkg/prelude/bootstrap.js:1887:22)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.runMain (pkg/prelude/bootstrap.js:1940:12)
    at node:internal/main/run_main_module:17:47 {
  tries: [
    '/snapshot/node-js-api/node_modules/deasync/build/deasync.node',
    '/snapshot/node-js-api/node_modules/deasync/build/Debug/deasync.node',
    '/snapshot/node-js-api/node_modules/deasync/build/Release/deasync.node',
    '/snapshot/node-js-api/node_modules/deasync/out/Debug/deasync.node',
    '/snapshot/node-js-api/node_modules/deasync/Debug/deasync.node',
    '/snapshot/node-js-api/node_modules/deasync/out/Release/deasync.node',
    '/snapshot/node-js-api/node_modules/deasync/Release/deasync.node',
    '/snapshot/node-js-api/node_modules/deasync/build/default/deasync.node',
    '/snapshot/node-js-api/node_modules/deasync/compiled/16.14.2/darwin/arm64/deasync.node',
    '/snapshot/node-js-api/node_modules/deasync/addon-build/release/install-root/deasync.node',
    '/snapshot/node-js-api/node_modules/deasync/addon-build/debug/install-root/deasync.node',
    '/snapshot/node-js-api/node_modules/deasync/addon-build/default/install-root/deasync.node',
    '/snapshot/node-js-api/node_modules/deasync/lib/binding/node-v93-darwin-arm64/deasync.node'
  ]
}

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

However, when I try running the script with node v16.14.2:
node my-api/main.js
The script works fine.

This is a great package, any advice to fix this, please?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions