abbr / deasync

Turns async function into sync via JavaScript wrapper of Node event loop
MIT License
971 stars 73 forks source link

No prebuilt available for darwin arm64 and error while building with MAC M1 chip #176

Open DennisMaass opened 1 year ago

DennisMaass commented 1 year ago

Hello everyone,

I can't run "pnpm install" successful because of the following error:

│ node:events:491 │ throw er; // Unhandled 'error' event │ ^ │ Error: spawn node-gyp ENOENT │ at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19) │ at onErrorNT (node:internal/child_process:478:16) │ at processTicksAndRejections (node:internal/process/task_queues:83:21) │ Emitted 'error' event on ChildProcess instance at: │ at Process.ChildProcess._handle.onexit (node:internal/child_process:289:12) │ at onErrorNT (node:internal/child_process:478:16) │ at processTicksAndRejections (node:internal/process/task_queues:83:21) { │ errno: -2, │ code: 'ENOENT', │ syscall: 'spawn node-gyp', │ path: 'node-gyp', │ spawnargs: [ 'rebuild' ]

Here some hopefully helpful information

OS: monterey 12.16 platform: darwin arch: arm64 (M1 pro) node: 16.17 package manager: pnpm

Does anyone have any idea how I can fix this error?

gabrielpiazzalunga commented 1 year ago

I have the same issue here. I'm trying to use darwin-x64-node-16, but I get the following incompatibility message deasync.node' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64'))

OS: MacOS Ventura 13.0.1 Node: 16.4.0 arch: arm64 (M1 Air)

From what I read in the https://github.com/abbr/deasync/issues/67 is it possible to generate a new version just adding the compatibility?

Thanks!

vonkanehoffen commented 1 year ago

This seems to be an issue only when installing deasync with pnpm for me:

pnpm add deasync@latest
Packages: +4
++++
Packages are hard linked from the content-addressable store to the virtual store.
  Content-addressable store is at: /Users/cormorant/Library/pnpm/store/v3
  Virtual store is at:             node_modules/.pnpm
node_modules/.pnpm/deasync@0.1.28/node_modules/deasync: Running install script, failed in 35ms
.../deasync@0.1.28/node_modules/deasync install$ node ./build.js
│ node:events:491
│       throw er; // Unhandled 'error' event
│       ^
│ Error: spawn node-gyp ENOENT
│     at Process.ChildProcess._handle.onexit (node:internal/child_process:285:19)
│     at onErrorNT (node:internal/child_process:485:16)
│     at processTicksAndRejections (node:internal/process/task_queues:83:21)
│ Emitted 'error' event on ChildProcess instance at:
│     at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
│     at onErrorNT (node:internal/child_process:485:16)
│     at processTicksAndRejections (node:internal/process/task_queues:83:21) {
│   errno: -2,
│   code: 'ENOENT',
│   syscall: 'spawn node-gyp',
│   path: 'node-gyp',
│   spawnargs: [ 'rebuild' ]
│ }
└─ Failed in 35ms
 ELIFECYCLE  Command failed with exit code 1.

It's fine with npm :

npm add deasync@latest

added 4 packages, and audited 5 packages in 3s

found 0 vulnerabilities

This is on an M1 Mac running Monterey, node v16.18.1, pnpm v7.18.1, npm v8.19.2

webark commented 1 year ago

also got this with node 19 and yarn 3.