discordjs / opus

Native opus bindings for node
MIT License
188 stars 53 forks source link

Apple Silicon (M1) support. #103

Closed kankajm closed 2 years ago

kankajm commented 2 years ago

Is your feature request related to a problem? Please describe. I'm unable to install this library on my M1 MacBook Air.

Describe the ideal solution Support for Apple Silicon. (MacOS arm64)

Describe alternatives you've considered I tried other libraries that should be alternatives to this library (opusscript)

silktg commented 2 years ago

Aw damn, same issue. Didn't know it doesn't support m1. Let's get this sorted please!

kyranet commented 2 years ago

Are you using https://github.com/discordjs/opus/releases/tag/v0.6.0? That version supports Apple Silicon, and this is a duplicate of #72.

silktg commented 2 years ago

Are you using https://github.com/discordjs/opus/releases/tag/v0.6.0? That version supports Apple Silicon, and this is a duplicate of #72.

@kyranet I am, and I'm receiving the following errors:

"command sh -c node-pre-gyp install --fallback-to-build" "node-pre-gyp info using node@16.9.1 | darwin | arm64 npm ERR! node-pre-gyp info check checked for "/Users/a/Desktop/Silk Music/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-darwin-arm64-unknown-unknown/opus.node" (not found) npm ERR! node-pre-gyp http GET https://github.com/discordjs/opus/releases/download/v0.6.0/opus-v0.6.0-node-v93-napi-v3-darwin-arm64-unknown-unknown.tar.gz npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.6.0/opus-v0.6.0-node-v93-napi-v3-darwin-arm64-unknown-unknown.tar.gz npm ERR! node-pre-gyp WARN Pre-built binaries not installable for @discordjs/opus@0.6.0 and node@16.9.1 (node-v93 ABI, unknown) (falling back to source compile with node-gyp) npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.6.0/opus-v0.6.0-node-v93-napi-v3-darwin-arm64-unknown-unknown.tar.gz npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@7.1.2 npm ERR! gyp info using node@16.9.1 | darwin | arm64 npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@7.1.2 npm ERR! gyp info using node@16.9.1 | darwin | arm64"

and a whole bunch of other issues.

edit: and if you go to those files they are in fact missing

kankajm commented 2 years ago

Are you using https://github.com/discordjs/opus/releases/tag/v0.6.0? That version supports Apple Silicon, and this is a duplicate of #72.

@kyranet I am, and I'm receiving the following errors:

"command sh -c node-pre-gyp install --fallback-to-build" "node-pre-gyp info using node@16.9.1 | darwin | arm64 npm ERR! node-pre-gyp info check checked for "/Users/a/Desktop/Silk Music/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-darwin-arm64-unknown-unknown/opus.node" (not found) npm ERR! node-pre-gyp http GET https://github.com/discordjs/opus/releases/download/v0.6.0/opus-v0.6.0-node-v93-napi-v3-darwin-arm64-unknown-unknown.tar.gz npm ERR! node-pre-gyp ERR! install response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.6.0/opus-v0.6.0-node-v93-napi-v3-darwin-arm64-unknown-unknown.tar.gz npm ERR! node-pre-gyp WARN Pre-built binaries not installable for @discordjs/opus@0.6.0 and node@16.9.1 (node-v93 ABI, unknown) (falling back to source compile with node-gyp) npm ERR! node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.6.0/opus-v0.6.0-node-v93-napi-v3-darwin-arm64-unknown-unknown.tar.gz npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@7.1.2 npm ERR! gyp info using node@16.9.1 | darwin | arm64 npm ERR! gyp info ok npm ERR! gyp info it worked if it ends with ok npm ERR! gyp info using node-gyp@7.1.2 npm ERR! gyp info using node@16.9.1 | darwin | arm64"

and a whole bunch of other issues.

edit: and if you go to those files they are in fact missing

I have the same issue.

yolocat-dev commented 2 years ago

Same issue here, why is this not possible on the M1? I mean it says in the README that macOS arm64 (basically m1) is supported...

gbyesiltas commented 2 years ago

Hey people, I have the same issue unfortunately

dongcheolpark commented 2 years ago

i have same issue too. library works good last year but recently it doesn't work. I tried installing it with yarn and also npm, but all gave the same error. this is my error message.

error /Users/parkdongcheol/programming/bardbot/node_modules/@discordjs/opus: Command failed.
Exit code: 1
Command: node-pre-gyp install --fallback-to-build
Arguments:
Directory: /Users/parkdongcheol/programming/bardbot/node_modules/@discordjs/opus
Output:
node-pre-gyp info it worked if it ends with ok
node-pre-gyp info using node-pre-gyp@0.4.2
node-pre-gyp info using node@16.8.0 | darwin | arm64
node-pre-gyp info check checked for "/Users/parkdongcheol/programming/bardbot/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-darwin-arm64-unknown-unknown/opus.node" (not found)
node-pre-gyp http GET https://github.com/discordjs/opus/releases/download/v0.5.3/opus-v0.5.3-node-v93-napi-v3-darwin-arm64-unknown-unknown.tar.gz
node-pre-gyp ERR! install response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.5.3/opus-v0.5.3-node-v93-napi-v3-darwin-arm64-unknown-unknown.tar.gz
node-pre-gyp WARN Pre-built binaries not installable for @discordjs/opus@0.5.3 and node@16.8.0 (node-v93 ABI, unknown) (falling back to source compile with node-gyp)
node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.5.3/opus-v0.5.3-node-v93-napi-v3-darwin-arm64-unknown-unknown.tar.gz
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@16.8.0 | darwin | arm64
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@16.8.0 | darwin | arm64
gyp info find Python using Python version 3.9.9 found at "/opt/homebrew/opt/python@3.9/bin/python3.9"
(node:7561) [DEP0150] DeprecationWarning: Setting process.config is deprecated. In the future the property will be read-only.
(Use `node --trace-deprecation ...` to show where the warning was created)
gyp info spawn /opt/homebrew/opt/python@3.9/bin/python3.9
gyp info spawn args [
gyp info spawn args   '/opt/homebrew/Cellar/node/16.8.0/libexec/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/parkdongcheol/programming/bardbot/node_modules/@discordjs/opus/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/opt/homebrew/Cellar/node/16.8.0/libexec/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/parkdongcheol/Library/Caches/node-gyp/16.8.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/parkdongcheol/Library/Caches/node-gyp/16.8.0',
gyp info spawn args   '-Dnode_gyp_dir=/opt/homebrew/Cellar/node/16.8.0/libexec/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/parkdongcheol/Library/Caches/node-gyp/16.8.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/parkdongcheol/programming/bardbot/node_modules/@discordjs/opus',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
gyp info ok
gyp info it worked if it ends with ok
gyp info using node-gyp@7.1.2
gyp info using node@16.8.0 | darwin | arm64
gyp info spawn make
gyp info spawn args [ 'BUILDTYPE=Release', '-C', 'build' ]
  CC(target) Release/obj.target/libopus/deps/opus/src/opus_multistream.o
  CC(target) Release/obj.target/libopus/deps/opus/src/opus_projection_encoder.o
  CC(target) Release/obj.target/libopus/deps/opus/src/analysis.o
  CC(target) Release/obj.target/libopus/deps/opus/src/mlp_data.o
  CC(target) Release/obj.target/libopus/deps/opus/src/opus_multistream_encoder.o
  CC(target) Release/obj.target/libopus/deps/opus/src/opus_projection_decoder.o
  CC(target) Release/obj.target/libopus/deps/opus/src/mapping_matrix.o
  CC(target) Release/obj.target/libopus/deps/opus/src/opus_compare.o
  CC(target) Release/obj.target/libopus/deps/opus/src/mlp.o
  CC(target) Release/obj.target/libopus/deps/opus/src/opus.o
  CC(target) Release/obj.target/libopus/deps/opus/src/opus_multistream_decoder.o
  CC(target) Release/obj.target/libopus/deps/opus/src/opus_decoder.o
In file included from ../deps/opus/src/opus_decoder.c:50:
In file included from ../deps/opus/silk/structs.h:32:
In file included from ../deps/opus/silk/SigProc_FIX.h:51:
../deps/opus/silk/arm/biquad_alt_arm.h:31:11: fatal error: 'celt/arm/armcpu.h' file not found
# include "celt/arm/armcpu.h"
          ^~~~~~~~~~~~~~~~~~~
1 error generated.
make: *** [Release/obj.target/libopus/deps/opus/src/opus_decoder.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/opt/homebrew/Cellar/node/16.8.0/libexec/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
gyp ERR! System Darwin 21.3.0
gyp ERR! command "/opt/homebrew/Cellar/node/16.8.0/bin/node" "/opt/homebrew/Cellar/node/16.8.0/libexec/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/parkdongcheol/programming/bardbot/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-darwin-arm64-unknown-unknown/opus.node" "--module_name=opus" "--module_path=/Users/parkdongcheol/programming/bardbot/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-darwin-arm64-unknown-unknown" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd /Users/parkdongcheol/programming/bardbot/node_modules/@discordjs/opus
gyp ERR! node -v v16.8.0
gyp ERR! node-gyp -v v7.1.2
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'node-gyp build --fallback-to-build --module=/Users/parkdongcheol/programming/bardbot/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-darwin-arm64-unknown-unknown/opus.node --module_name=opus --module_path=/Users/parkdongcheol/programming/bardbot/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-darwin-arm64-unknown-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/parkdongcheol/programming/bardbot/node_modules/@discordjs/node-pre-gyp/lib/util/compile.js:85:20)
node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
node-pre-gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
node-pre-gyp ERR! System Darwin 21.3.0
node-pre-gyp ERR! command "/opt/homebrew/Cellar/node/16.8.0/bin/node" "/Users/parkdongcheol/programming/bardbot/node_modules/@discordjs/opus/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/parkdongcheol/programming/bardbot/node_modules/@discordjs/opus
node-pre-gyp ERR! node -v v16.8.0
node-pre-gyp ERR! node-pre-gyp -v v0.4.2
node-pre-gyp ERR! not ok
Failed to execute 'node-gyp build --fallback-to-build --module=/Users/parkdongcheol/programming/bardbot/node_modules/@discordjs/opus/prebuild/node-v93-napi-v3-darwin-arm64-unknown-unknown/opus.node --module_name=opus --module_path=/Users/parkdongcheol/programming/bardbot/node_modules/@discordjs/opus/prebuild/node-v
iCrawl commented 2 years ago

Installs fine on my M1 (14", 2021), 12.4

darklight147 commented 1 year ago

hello i still have this issue?

darklight147 commented 1 year ago

here is the stacktrace:


1 warning generated.
  CC(target) Release/obj.target/libopus/deps/opus/celt/kiss_fft.o
  CC(target) Release/obj.target/libopus/deps/opus/celt/entenc.o
  CC(target) Release/obj.target/libopus/deps/opus/celt/mathops.o
  CC(target) Release/obj.target/libopus/deps/opus/celt/pitch.o
  CC(target) Release/obj.target/libopus/deps/opus/celt/arm/arm_celt_map.o
  CC(target) Release/obj.target/libopus/deps/opus/celt/arm/armcpu.o
  CC(target) Release/obj.target/libopus/deps/opus/celt/arm/celt_neon_intr.o
  CC(target) Release/obj.target/libopus/deps/opus/celt/arm/pitch_neon_intr.o
  LIBTOOL-STATIC Release/opus.a
env: python: No such file or directory
make: *** [Release/opus.a] Error 127
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/Users/quasimodo/.nvm/versions/node/v14.21.2/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Darwin 22.3.0
gyp ERR! command "/Users/quasimodo/.nvm/versions/node/v14.21.2/bin/node" "/Users/quasimodo/.nvm/versions/node/v14.21.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/Users/quasimodo/Documents/workspace/Discord-Music-Master/node_modules/@discordjs/opus/prebuild/node-v83-napi-v3-darwin-arm64-unknown-unknown/opus.node" "--module_name=opus" "--module_path=/Users/quasimodo/Documents/workspace/Discord-Music-Master/node_modules/@discordjs/opus/prebuild/node-v83-napi-v3-darwin-arm64-unknown-unknown" "--napi_version=8" "--node_abi_napi=napi" "--napi_build_version=3" "--node_napi_label=napi-v3"
gyp ERR! cwd /Users/quasimodo/Documents/workspace/Discord-Music-Master/node_modules/@discordjs/opus
gyp ERR! node -v v14.21.2
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/Users/quasimodo/.nvm/versions/node/v14.21.2/bin/node /Users/quasimodo/.nvm/versions/node/v14.21.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/quasimodo/Documents/workspace/Discord-Music-Master/node_modules/@discordjs/opus/prebuild/node-v83-napi-v3-darwin-arm64-unknown-unknown/opus.node --module_name=opus --module_path=/Users/quasimodo/Documents/workspace/Discord-Music-Master/node_modules/@discordjs/opus/prebuild/node-v83-napi-v3-darwin-arm64-unknown-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/Users/quasimodo/Documents/workspace/Discord-Music-Master/node_modules/@discordjs/node-pre-gyp/lib/util/compile.js:85:20)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:1088:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:296:5)
node-pre-gyp ERR! System Darwin 22.3.0
node-pre-gyp ERR! command "/Users/quasimodo/.nvm/versions/node/v14.21.2/bin/node" "/Users/quasimodo/Documents/workspace/Discord-Music-Master/node_modules/@discordjs/opus/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /Users/quasimodo/Documents/workspace/Discord-Music-Master/node_modules/@discordjs/opus
node-pre-gyp ERR! node -v v14.21.2
node-pre-gyp ERR! node-pre-gyp -v v0.4.5
node-pre-gyp ERR! not ok 
Failed to execute '/Users/quasimodo/.nvm/versions/node/v14.21.2/bin/node /Users/quasimodo/.nvm/versions/node/v14.21.2/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/Users/quasimodo/Documents/workspace/Discord-Music-Master/node_modules/@discordjs/opus/prebuild/node-v83-napi-v3-darwin-arm64-unknown-unknown/opus.node --module_name=opus --module_path=/Users/quasimodo/Documents/workspace/Discord-Music-Master/node_modules/@discordjs/opus/prebuild/node-v83-napi-v3-darwin-arm64-unknown-unknown --napi_version=8 --node_abi_napi=napi --napi_build_version=3 --node_napi_label=napi-v3' (1)
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
yolocat-dev commented 1 year ago

Most likely your Node.js version is too outdated. Install NVM and install the latest LTS version and try again. If the problem persists, send the new stacktrace.

Also, the issue is closed due to this being fixed already. Learn Google, dude.

darklight147 commented 1 year ago

I think you are a developer enough to understand that not all issues can be solved by "just updating your node version", since you might have other dependencies that won't work with newer versions, also the documents says that this library works with any node version newer than 12:

image

Also github issues exist for a a reason, Dude

yolocat-dev commented 1 year ago

and the "closed" tag exists for a reason lmao

darklight147 commented 1 year ago

Glad you took part in this issue, by providing....nothing, here is your achivement

image
yolocat-dev commented 1 year ago

and you still haven't updated node, +1