Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pnpm install fails on @discordjs/opus #34

Open
sicco-moonbeam opened this issue Dec 30, 2024 · 18 comments
Open

pnpm install fails on @discordjs/opus #34

sicco-moonbeam opened this issue Dec 30, 2024 · 18 comments

Comments

@sicco-moonbeam
Copy link

sicco-moonbeam commented Dec 30, 2024

I've been following along with the AI Agent Dev School and I can't for the life of me get the eliza-starter to work.

I get the following error:

pnpm install
Downloading @huggingface/transformers@3.0.1: 8.77 MB/8.77 MB, done
Downloading @echogarden/espeak-ng-emscripten@0.3.0: 12.53 MB/12.53 MB, done
 WARN  19 deprecated subdependencies found: @cliqz/adblocker-content@1.34.0, @cliqz/adblocker-extended-selectors@1.34.0, @cliqz/adblocker-playwright@1.34.0, @cliqz/adblocker@1.34.0, @discordjs/voice@0.17.0, are-we-there-yet@2.0.0, are-we-there-yet@3.0.1, bin-version-check@6.0.0, gauge@3.0.2, gauge@4.0.4, glob@7.2.3, har-validator@5.1.5, inflight@1.0.6, npmlog@5.0.1, npmlog@6.0.2, puppeteer@19.11.1, request@2.88.2, rimraf@3.0.2, uuid@3.4.0
Packages: +1334
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Progress: resolved 1436, reused 1292, downloaded 43, added 877, done
node_modules/.pnpm/ffmpeg-static@5.2.0/node_modules/ffmpeg-static: Running install script, done in 905ms
node_modules/.pnpm/canvas@2.11.2/node_modules/canvas: Running install script...
node_modules/.pnpm/canvas@2.11.2/node_modules/canvas: Running install script, failed in 5.2s (skipped as optional)
node_modules/.pnpm/node-llama-cpp@3.1.1_typescript@5.6.3/node_modules/node-llama-cpp: Running postinstall script...
node_modules/.pnpm/node-llama-cpp@3.1.1_typescript@5.6.3/node_modules/node-llama-cpp: Running postinstall script, done in 3.9s
node_modules/.pnpm/better-sqlite3@11.5.0/node_modules/better-sqlite3: Running install script, done in 2.5s
node_modules/.pnpm/wtf_wikipedia@10.3.2/node_modules/wtf_wikipedia: Running postinstall script, done in 1.7s332033ff7d5f9fb02/nnode_modules/.pnpm/@discordjs+opus@https+++codeload.github.com+discordjs+opus+tar.gz+31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02/node_modules/@discordjs/opus: Running install script, failed in 4.3sRunning install script...
.../node_modules/@discordjs/opus install$ node-pre-gyp install --fallback-to-build
│ node-pre-gyp info it worked if it ends with ok
│ node-pre-gyp info using node-pre-gyp@0.4.5
│ node-pre-gyp info using node@23.3.0 | win32 | x64
│ (node:33980) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead.
│ (Use node --trace-deprecation ... to show where the warning was created)
│ node-pre-gyp info check checked for "C:\Users\naets\OneDrive\Documents\Moonbeam\Workspaces\eliza-starter\node_modules.pnp…
│ node-pre-gyp http GET https://github.com/discordjs/opus/releases/download/v0.9.0/opus-v0.9.0-node-v131-napi-v3-win32-x64-u…
│ node-pre-gyp ERR! install response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.9.0/opus…
│ node-pre-gyp WARN Pre-built binaries not installable for @discordjs/opus@0.9.0 and node@23.3.0 (node-v131 ABI, unknown) (f…
│ node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.9.0/op…
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@10.2.0
│ gyp info using node@23.3.0 | win32 | x64
│ gyp info ok
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@10.2.0
│ gyp info using node@23.3.0 | win32 | x64
│ gyp info find Python using Python version 3.13.1 found at "C:\Users\naets\AppData\Local\Programs\Python\Python313\python.e…
│ gyp info find VS using VS2022 (17.12.35527.113) found at:
│ gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
│ gyp info find VS run with --verbose for detailed information
│ gyp info spawn C:\Users\naets\AppData\Local\Programs\Python\Python313\python.exe
│ gyp info spawn args [
│ gyp info spawn args 'C:\Users\naets\AppData\Roaming\nvm\v23.3.0\node_modules\pnpm\dist\node_modules\node-gyp\g…
│ gyp info spawn args 'binding.gyp',
│ gyp info spawn args '-f',
│ gyp info spawn args 'msvs',
│ gyp info spawn args '-I',
│ gyp info spawn args 'C:\Users\naets\OneDrive\Documents\Moonbeam\Workspaces\eliza-starter\node_modules\.pnpm\@dis
│ gyp info spawn args '-I',
│ gyp info spawn args 'C:\Users\naets\AppData\Roaming\nvm\v23.3.0\node_modules\pnpm\dist\node_modules\node-gyp\a…
│ gyp info spawn args '-I',
│ gyp info spawn args 'C:\Users\naets\AppData\Local\node-gyp\Cache\23.3.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=C:\Users\naets\AppData\Local\node-gyp\Cache\23.3.0',
│ gyp info spawn args '-Dnode_gyp_dir=C:\Users\naets\AppData\Roaming\nvm\v23.3.0\node_modules\pnpm\dist\node_modul…
│ gyp info spawn args '-Dnode_lib_file=C:\\Users\\naets\\AppData\\Local\\node-gyp\\Cache\\23.3.0\\<(target_a…
│ gyp info spawn args '-Dmodule_root_dir=C:\Users\naets\OneDrive\Documents\Moonbeam\Workspaces\eliza-starter\node_mo…
│ 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 'C:\Users\naets\OneDrive\Documents\Moonbeam\Workspaces\eliza-starter\node_modules\.pnpm\@dis
│ gyp info spawn args '-Goutput_dir=.'
│ gyp info spawn args ]
│ :43: SyntaxWarning: invalid escape sequence '$'
│ gyp info ok
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@10.2.0
│ gyp info using node@23.3.0 | win32 | x64
│ gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe
│ gyp info spawn args [
│ gyp info spawn args 'build\binding.sln',
│ gyp info spawn args '/clp:Verbosity=minimal',
│ gyp info spawn args '/nologo',
│ gyp info spawn args '/p:Configuration=Release;Platform=x64'
│ gyp info spawn args ]
│ opus_multistream.c
│ \deps\opus\src\opus_multistream.c(1,1): error C1083: Cannot open source file: '....\deps\opus\src\opus_multistream.c': No…
│ (compiling source file '/deps/opus/src/opus_multistream.c')

│ gyp ERR! build error
│ gyp ERR! stack Error: C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe fai…
│ gyp ERR! stack at ChildProcess. (C:\Users\naets\AppData\Roaming\nvm\v23.3.0\node_modules\pnpm\dist\node_modules…
│ gyp ERR! stack at ChildProcess.emit (node:events:513:28)
│ gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
│ gyp ERR! System Windows_NT 10.0.22631
│ gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\naets\AppData\Roaming\nvm\v23.3.0\node_modules\pn…
│ gyp ERR! cwd C:\Users\naets\OneDrive\Documents\Moonbeam\Workspaces\eliza-starter\node_modules.pnpm@discordjs+opus@https+…
│ gyp ERR! node -v v23.3.0
│ gyp ERR! node-gyp -v v10.2.0
│ gyp ERR! not ok
│ node-pre-gyp ERR! build error
│ node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\naets\AppData\Roaming\nvm\v23.…
│ node-pre-gyp ERR! stack at ChildProcess. (C:\Users\naets\OneDrive\Documents\Moonbeam\Workspaces\eliza-start…
│ node-pre-gyp ERR! stack at ChildProcess.emit (node:events:513:28)
│ node-pre-gyp ERR! stack at maybeClose (node:internal/child_process:1101:16)
│ node-pre-gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:305:5)
│ node-pre-gyp ERR! System Windows_NT 10.0.22631
│ node-pre-gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Users\naets\OneDrive\Documents\Moonbeam\Workspac…
│ Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\naets\AppData\Roaming\nvm\v23.3.0\node_modules\pnpm\dist\node…
│ node-pre-gyp ERR! cwd C:\Users\naets\OneDrive\Documents\Moonbeam\Workspaces\eliza-starter\node_modules.pnpm@discordjs+op…
│ node-pre-gyp ERR! node -v v23.3.0
│ node-pre-gyp ERR! node-pre-gyp -v v0.4.5
│ node-pre-gyp ERR! not ok
└─ Failed in 4.3s at C:\Users\naets\OneDrive\Documents\Moonbeam\Workspaces\eliza-starter\node_modules.pnpm@discordjs+opus@https+++codeload.github.com+discordjs+opus+tar.gz+31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02\node_modules@discordjs\opus
node_modules/.pnpm/bigint-buffer@1.1.5/node_modules/bigint-buffer: Running install script...
 ELIFECYCLE  Command failed with exit code 1.

 This on win 11, node v23.3.0, pnpm 9.15.0

@CollinsMunene
Copy link

Hi, try and check the python version, it works with version 11

@omidsakhi
Copy link

I had the same issue, followed @CollinsMunene , still failed but installed "sudo apt install build-essential" and moved passed this error. I had python 3.12 before and not sure if build-essential was the only missing dependency however switching to 3.11.11 didn't resolve it for me by itself. On to another issue ...

@Nirator78
Copy link

@Gmetisl2
Copy link

Gmetisl2 commented Jan 6, 2025

Comment out discordjs\opus if you don't use Discord client will solve the issue -although it's not the solution but quick fix

@taesuklee
Copy link

Comment out discordjs\opus if you don't use Discord client will solve the issue -although it's not the solution but quick fix

@Gmetisl2 meant here, I suppose, getting rid of the @elizaos/client-discord in package.json
If discord does not need to be integrated in the agent

@sicco-moonbeam
Copy link
Author

@Nirator78 I installed Desktop Development C++ but still get the same error. Also tried downgrading to python 3.11.0 using pyenv-win but same error.

Unfortunately, I need discord...

What's weird is that I don't get this error when I fork the main eliza repo (and that obviously has the discord integration as well)

@Nirator78
Copy link

@sicco-moonbeam it's excactly the same error after installing Desktop Development C++ or another error ?

@sicco-moonbeam
Copy link
Author

@Nirator78 exact same error

@Nirator78
Copy link

I got the same error now

402143506-32de3062-b0f7-4d25-b792-c6585d9d22ba

Release of discordjs opus not found

node-pre-gyp http GET https://github.com/discordjs/opus/releases/download/v0.9.0/opus-v0.9.0-node-v127-napi-v3-win32-x64-unknown-unknown.tar.gz │ node-pre-gyp ERR! install response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.9.0/opus-v0.9.0-node-v127-napi-v3-win32-x64-unknown-unknown.tar.gz │ node-pre-gyp WARN Pre-built binaries not installable for @discordjs/opus@0.9.0 and node@22.13.0 (node-v127 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.9.0/opus-v0.9.0-node-v127-napi-v3-win32-x64-unknown-unknown.tar.gz

@JoeyKhd
Copy link
Member

JoeyKhd commented Jan 13, 2025

downgrading nodejs to 22.13 solved it for me.

@wtfsayo wtfsayo closed this as completed Jan 13, 2025
@aaron-adimverse
Copy link

Experiencing the same issues running branch v0.1.8-alpha.1 with node 23.3.0 & 22.13.0.

@odilitime odilitime reopened this Jan 29, 2025
@odilitime
Copy link

Re-opening due to users on chat asking about it still

@CL-LLC
Copy link

CL-LLC commented Jan 29, 2025

Experiencing the same issues running branch v0.1.8-alpha.1 with node 23.3.0 & 22.13.0.

@sicco-moonbeam
Copy link
Author

sicco-moonbeam commented Jan 30, 2025

FWIW, I've been able to fix it but it was pretty cumbersome. I had to:

  • install WSL

  • install python 3.13.1 (using pyenv) inside WSL

  • install node 23.3.0 (using nvm) inside WSL

  • install pnpm inside WSL

  • Upgrade the ubuntu version in WSL to 24.04.1 ( I got build errors on the default WSL version, which I believe was 20.20.x something)

  • install git into WSL

  • ensure pyenv,nvm, python, node, pnpm and git are all loaded via the WSL .profile PATH

  • map the WSL filesystem as a network drive

  • configure the WSL git installation to default to linux line endings and ignore permission changes
    (i.e.:
    git config core.autocrlf input
    git config core.filemode false

  • check out eliza-starter (or elizaOS) using the WSL git client

  • then open it in a windows git client (I use git-fork)

  • install VSC

  • install the WSL extension in VSC

  • connect VSC to WSL

  • pnpm install & build

  • port-forward from WSL to the host machine.

Doing this lets you run both eliza-starter and elizaOS without issue and without the windows git client messing up permissions inside the ubuntu VM. It works, but it's a lot of work. Far as I can tell, there are only two things that stand in the way of eliza working on native windows; and that's the build for discord/opus and the client/version.sh file which will not run inside bash on powershell. Client/version.sh was not present in older versions of ElizaOS (v.0.1.7 for example) and opus seems to have just pulled from an npm repo (versus building from github source as it does now) and I was able to get it working on native windows.

On the flip side, on ubuntu pnpm install & build + eliza startup are way faster than on native windows.

Anyway, hope this helps!

@isengartz
Copy link

Running version 0.1.10 I'm facing the issue too. I've tried with both 22.13.0 and 23.3.0

@aaron-adimverse
Copy link

Fixed with @omidsakhi 's advice:
sudo apt install build-essential

I'm running the develop branch with node 23.3.0 on Ubuntu 24.

@themaxermister
Copy link

Having the same issue and met with this:

19.12  ERROR  Command failed with exit code 128: /usr/bin/git clone git@github.com:discordjs/opus.git /root/.local/share/pnpm/store/v3/tmp/_tmp_7_780be1ca870f2f98ce78078c36c0ec73
19.12 Cloning into '/root/.local/share/pnpm/store/v3/tmp/_tmp_7_780be1ca870f2f98ce78078c36c0ec73'...
19.12 Host key verification failed.
19.12 fatal: Could not read from remote repository.
19.12 
19.12 Please make sure you have the correct access rights
19.12 and the repository exists.
19.12 
19.12 pnpm: Command failed with exit code 128: /usr/bin/git clone git@github.com:discordjs/opus.git /root/.local/share/pnpm/store/v3/tmp/_tmp_7_780be1ca870f2f98ce78078c36c0ec73
19.12 Cloning into '/root/.local/share/pnpm/store/v3/tmp/_tmp_7_780be1ca870f2f98ce78078c36c0ec73'...
19.12 Host key verification failed.
19.12 fatal: Could not read from remote repository.
19.12 
19.12 Please make sure you have the correct access rights
19.12 and the repository exists.
19.12     at makeError (/usr/local/lib/node_modules/pnpm/dist/pnpm.cjs:17863:17)
19.12     at handlePromise (/usr/local/lib/node_modules/pnpm/dist/pnpm.cjs:18434:33)
19.12     at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
19.12     at async execGit (/usr/local/lib/node_modules/pnpm/dist/pnpm.cjs:114189:7)
19.12     at async gitFetcher (/usr/local/lib/node_modules/pnpm/dist/pnpm.cjs:114144:11)
19.12     at async fetcher (/usr/local/lib/node_modules/pnpm/dist/pnpm.cjs:133706:16)
19.12     at async run (/usr/local/lib/node_modules/pnpm/dist/pnpm.cjs:133156:23)
------
failed to solve: process "/bin/sh -c pnpm install" did not complete successfully: exit code: 1

it was working fine last week. Currently using it with node 22.13.0.

@wtfsayo
Copy link
Member

wtfsayo commented Feb 4, 2025

Seem to be due to an issue in discord client

"@elizaos/client-discord": "0.1.9",

recommend to use 0.1.7 or removing this dependency if not using discord client! will push a fix soon on package

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests