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

Pnmp install failed with this - ELIFECYCLE  Command failed with exit code 1(Windows/WSL) #1041

Closed
rafsan3503 opened this issue Dec 13, 2024 · 9 comments
Labels
bug Something isn't working

Comments

@rafsan3503
Copy link

I have been trying to solve this issue for last 2 days. im using node 23.4 but i tried changing version even with WSL2 im always getting this error. If anyone has a solution please share. TIA

Progress: resolved 1434, reused 1339, downloaded 0, added 0, done
node_modules/.pnpm/ffmpeg-static@5.2.0/node_modules/ffmpeg-static: Running install script, done in 102ms
node_modules/.pnpm/onnxruntime-node@1.20.0/node_modules/onnxruntime-node: Running postinstall script, done in 116ms
node_modules/.pnpm/canvas@2.11.2/node_modules/canvas: Running install script...
node_modules/.pnpm/sharp@0.33.5/node_modules/sharp: Running install script...
node_modules/.pnpm/sharp@0.33.5/node_modules/sharp: Running install script, done in 183msin 42ms
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 inode_modules/.pnpm/@discordjs+opus@https+++codeload.github.com+discordjs+opus+tar.gz+31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02/node_modules/@discordjs/opus: Running install script, failed in 1.1sl script, done in 40ms
.../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.4.0 | linux | x64
│ (node:1199) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative in…
│ (Use node --trace-deprecation ... to show where the warning was created)
│ node-pre-gyp info check checked for "/home/mahmud/eliza-starter/node_modules/.pnpm/@discordjs+opus@https+++codeload…
│ node-pre-gyp http GET https://github.com/discordjs/opus/releases/download/v0.9.0/opus-v0.9.0-node-v131-napi-v3-linu…
│ node-pre-gyp ERR! install response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0.9…
│ node-pre-gyp WARN Pre-built binaries not installable for @discordjs/opus@0.9.0 and node@23.4.0 (node-v131 ABI, glib…
│ node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/discordjs/opus/releases/download/v0…
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@11.0.0
│ gyp info using node@23.4.0 | linux | x64
│ gyp info ok
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@11.0.0
│ gyp info using node@23.4.0 | linux | x64
│ gyp info find Python using Python version 3.12.3 found at "/usr/bin/python3"
│ gyp info spawn /usr/bin/python3
│ gyp info spawn args [
│ gyp info spawn args '/home/mahmud/.nvm/versions/node/v23.4.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_mai…
│ 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 '/home/mahmud/eliza-starter/node_modules/.pnpm/@discordjs+opus@https+++codeload.github.com+disc…
│ gyp info spawn args '-I',
│ gyp info spawn args '/home/mahmud/.nvm/versions/node/v23.4.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
│ gyp info spawn args '-I',
│ gyp info spawn args '/home/mahmud/.cache/node-gyp/23.4.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=/home/mahmud/.cache/node-gyp/23.4.0',
│ gyp info spawn args '-Dnode_gyp_dir=/home/mahmud/.nvm/versions/node/v23.4.0/lib/node_modules/npm/node_modules/node-…
│ gyp info spawn args '-Dnode_lib_file=/home/mahmud/.cache/node-gyp/23.4.0/<(target_arch)/node.lib',
│ gyp info spawn args '-Dmodule_root_dir=/home/mahmud/eliza-starter/node_modules/.pnpm/@discordjs+opus@https+++codelo…
│ 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 ]
│ :43: SyntaxWarning: invalid escape sequence '$'
│ gyp info ok
│ gyp info it worked if it ends with ok
│ gyp info using node-gyp@11.0.0
│ gyp info using node@23.4.0 | linux | x64
│ gyp ERR! build error
│ gyp ERR! stack Error: not found: make
│ gyp ERR! stack at getNotFoundError (/home/mahmud/.nvm/versions/node/v23.4.0/lib/node_modules/npm/node_modules/which…
│ gyp ERR! stack at which (/home/mahmud/.nvm/versions/node/v23.4.0/lib/node_modules/npm/node_modules/which/lib/index.…
│ gyp ERR! stack at async doWhich (/home/mahmud/.nvm/versions/node/v23.4.0/lib/node_modules/npm/node_modules/node-gyp…
│ gyp ERR! stack at async loadConfigGypi (/home/mahmud/.nvm/versions/node/v23.4.0/lib/node_modules/npm/node_modules/n…
│ gyp ERR! stack at async build (/home/mahmud/.nvm/versions/node/v23.4.0/lib/node_modules/npm/node_modules/node-gyp/l…
│ gyp ERR! stack at async run (/home/mahmud/.nvm/versions/node/v23.4.0/lib/node_modules/npm/node_modules/node-gyp/bin…
│ gyp ERR! System Linux 5.15.167.4-microsoft-standard-WSL2
│ gyp ERR! command "/home/mahmud/.nvm/versions/node/v23.4.0/bin/node" "/home/mahmud/.nvm/versions/node/v23.4.0/lib/no…
│ gyp ERR! cwd /home/mahmud/eliza-starter/node_modules/.pnpm/@discordjs+opus@https+++codeload.github.com+discordjs+op…
│ gyp ERR! node -v v23.4.0
│ gyp ERR! node-gyp -v v11.0.0
│ gyp ERR! not ok
│ node-pre-gyp ERR! build error
│ node-pre-gyp ERR! stack Error: Failed to execute '/home/mahmud/.nvm/versions/node/v23.4.0/bin/node /home/mahmud/.nv…
│ node-pre-gyp ERR! stack at ChildProcess. (/home/mahmud/eliza-starter/node_modules/.pnpm/@discordjs+n…
│ 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 Linux 5.15.167.4-microsoft-standard-WSL2
│ node-pre-gyp ERR! command "/home/mahmud/.nvm/versions/node/v23.4.0/bin/node" "/home/mahmud/eliza-starter/node_modul…
│ node-pre-gyp ERR! cwd /home/mahmud/eliza-starter/node_modules/.pnpm/@discordjs+opus@https+++codeload.github.com+dis…
│ node-pre-gyp ERR! node -v v23.4.0
│ node-pre-gyp ERR! node-pre-gyp -v v0.4.5
│ node-pre-gyp ERR! not ok
│ Failed to execute '/home/mahmud/.nvm/versions/node/v23.4.0/bin/node /home/mahmud/.nvm/versions/node/v23.4.0/lib/nod…
└─ Failed in 1.1s at /home/mahmud/eliza-starter/node_modules/.pnpm/@discordjs+opus@https+++codeload.github.com+discordjs+opus+tar.gz+31da49d8d2cc6c5a2ab1bfd332033ff7d5f9fb02/node_modules/@discordjs/opus
node_modules/.pnpm/esbuild@0.21.5/node_modules/esbuild: Running postinstall script, done in 40ms
 ELIFECYCLE  Command failed with exit code 1.

@rafsan3503 rafsan3503 added the bug Something isn't working label Dec 13, 2024
@syscry
Copy link

syscry commented Dec 13, 2024

+1

@syscry
Copy link

syscry commented Dec 14, 2024

 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @ai16z/agent@0.1.5-alpha.5 start: node --loader ts-node/esm src/index.ts "--isRoot"
Exit status 1
 ELIFECYCLE  Command failed with exit code 1.

@NikitaVr
Copy link

Some combination of these worked for me

#278

Try the following:

downgrade to node v20 nvm install 20 && nvm use 20
remove node modules and lock file rm -rf node_modules && rm pnpm-lock.yaml
rerun install pnpm i

Also this #215 (comment)

apt update
apt install -y build-essential

And finally building only worked by downgrading to Node 20, but then running only works on node 23.3

Will follow up with possible a simpler set of fixes, but this got it working on my end.

@NikitaVr
Copy link

I also noticed there is now a WSL setup guide https://ai16z.github.io/eliza/docs/guides/wsl/

@Legionaaa
Copy link

Some combination of these worked for me

#278

Try the following:

downgrade to node v20 nvm install 20 && nvm use 20 remove node modules and lock file rm -rf node_modules && rm pnpm-lock.yaml rerun install pnpm i

Also this #215 (comment)

apt update
apt install -y build-essential

And finally building only worked by downgrading to Node 20, but then running only works on node 23.3

Will follow up with possible a simpler set of fixes, but this got it working on my end.

The issue with this (certainly on ubuntu) is you can't then get around the sqllite issue on start.

Would be great if a proper fix could be put in place.

@ileana-pr
Copy link
Contributor

@rafsan3503 Steps I took to fix Discord Opus issue:
First, ensure your WSL environment is up to date:sudo apt update && sudo apt upgrade

  • If you are on Windows, first, ensure your WSL environment is up to date:

    sudo apt update && sudo apt upgrade
    
  • Make sure all the build essentials and audio dependencies are installed:

    sudo apt-get install -y \

    build-essential \

    python3 \

    python3-pip \

    git \

    curl \

    nodejs-dev \

    node-gyp \

    ffmpeg \

    libtool-bin \

    autoconf \

    automake \

    libopus-dev \

  • If you need to interact with Windows audio (for Discord bot development, etc.), you might need to:

    • Install the Windows version of ffmpeg as well
    • Configure your application to use the correct audio devices
  • Make sure you are using Node 23

    nvm install 23

    nvm use 23

  • Clear your npm cache and node_modules:

    npm cache clean --force

    rm -rf node_modules package-lock.json

    pnpm install

  • Install @discordjs/opus with the following flag:

    npm install @discordjs/opus --build-from-source
    

@ileana-pr
Copy link
Contributor

ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @ai16z/agent@0.1.5-alpha.5 start: node --loader ts-node/esm src/index.ts "--isRoot" Exit status 1  ELIFECYCLE  Command failed with exit code 1.

Try this:

  • First, clean and rebuild:

    # Clean everything

    pnpm clean

    # Reinstall dependencies

    pnpm install

    # Build the project

    pnpm build
  • If that doesn't work, try adding required types:

    # Add dependencies to workspace root

    pnpm add -w -D ts-node typescript @types/node
  • Then try starting again

@AIFlowML
Copy link
Collaborator

AIFlowML commented Jan 3, 2025

Hello !
Please let us know if rhe issue persist i found this also in other issues much older.
My take is to try the latest version and repost back
Here some tips to try fix.

Comprehensive Solution

TLDR (Executive Summary)

  • Issue essence: pnpm install fails with ELIFECYCLE error for @discordjs/opus.
  • Root cause: Missing pre-built binary (404 error) and missing build tools (make) in WSL2.
  • Solution approach: Install build tools, verify Node.js compatibility, and manually install @discordjs/opus.
  • Impact assessment: Prevents successful installation of @discordjs/opus, affecting audio processing in Discord bots.

Quick Resolution Path

  1. Install Build Tools:
    sudo apt-get install build-essential
  2. Verify Node.js Compatibility:
    • Check @discordjs/opus documentation for compatible Node.js versions.
  3. Manual Installation:
    git clone https://github.com/discordjs/opus.git
    cd opus
    npm install
  4. Alternative Installation:
    npm install @discordjs/opus --build-from-source

Comprehensive Solution

  1. Install Build Tools:
    • Ensure the WSL2 environment has all necessary build tools:
      sudo apt-get install build-essential
  2. Check Node.js Version Compatibility:
    • Verify that the Node.js version (23.4.0) is compatible with @discordjs/opus. If not, consider using nvm to switch to a compatible version:
      nvm install 16.13.0
      nvm use 16.13.0
  3. Manual Installation of @discordjs/opus:
    • Clone the repository and build from source:
      git clone https://github.com/discordjs/opus.git
      cd opus
      npm install
  4. Alternative Installation Method:
    • Use the --build-from-source flag to install the package:
      npm install @discordjs/opus --build-from-source

@AIFlowML
Copy link
Collaborator

AIFlowML commented Jan 6, 2025

Issue related to the install on of opus
Not specify the version but since i install all on same linux 6 days ago i guess it is mostly related to the permission and the way linux hahdel Opus.
I think we can consider this closed and not a bu related to the code but mostly to permissions.
I close this now.

@AIFlowML AIFlowML closed this as completed Jan 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

6 participants