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 Ubuntu #215

Closed
lo-zed opened this issue Nov 6, 2024 · 7 comments
Closed

pnpm install fails on Ubuntu #215

lo-zed opened this issue Nov 6, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@lo-zed
Copy link

lo-zed commented Nov 6, 2024

Describe the bug

Installation fails

To Reproduce

pnpm i

Expected behavior

Installs without error.

Additional context

OS: Ubuntu 24.04 LTS
node: v22.10.1
pnpm: 9.12.3

An example of error I get:

node_modules/sharp install$ (node install/libvips && node install/dll-copy && prebuild-install) || (node install/can-compile && node-gyp rebuild && node install/dll-copy)
└─ Failed in 283ms at /home/ubuntu/eliza/node_modules/sharp

Happens with @discordjs/opus & onnxruntime-node too, maybe others.

But if I go into the directory and install from there it works:

cd node_modules/sharp
npm install

This doesn't throw any error and installs the package correctly.

Is this a bug on pnpm side?

@lo-zed lo-zed added the bug Something isn't working label Nov 6, 2024
@Sid31
Copy link

Sid31 commented Nov 7, 2024

Did you try pnpm install --include=optional sharp ?

@lo-zed
Copy link
Author

lo-zed commented Nov 7, 2024

yes, same error unfortunately

@lo-zed
Copy link
Author

lo-zed commented Nov 12, 2024

issue created at pnpm repo too: pnpm/pnpm#8737

@metadiver
Copy link
Contributor

related #237

@lo-zed
Copy link
Author

lo-zed commented Nov 13, 2024

Hi, thanks for your help. I tried but with no success. How do you add python to the path? I tried:

  • a bash alias
  • a link python -> python3
  • adding the python path to .env in the project base dir

Also would you know how to get useful debug info? I tried --reporter ndjson but couldn't find the reason why the install fails

@sirkitree
Copy link
Collaborator

Try the following:

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

@sais-github
Copy link

sais-github commented Nov 24, 2024

I was running into the same issue,
apt update
apt install -y build-essential
Resolved the error

It seems the error was caused by make not being installed?

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 [email protected]
│ node-pre-gyp info using [email protected] | linux | x64
│ (node:2738) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userl…
│ (Use `node --trace-deprecation ...` to show where the warning was created)
│ node-pre-gyp info check checked for "/home/box/eliza/node_modules/@discordjs/opus/prebuild/node-v…
│ node-pre-gyp http GET https://github.com/discordjs/opus/releases/download/v0.9.0/opus-v0.9.0-node…
│ node-pre-gyp ERR! install response status 404 Not Found on https://github.com/discordjs/opus/rele…
│ node-pre-gyp WARN Pre-built binaries not installable for @discordjs/[email protected] and [email protected] (n…
│ node-pre-gyp WARN Hit error response status 404 Not Found on https://github.com/discordjs/opus/re…
│ gyp info it worked if it ends with ok
│ gyp info using [email protected]
│ gyp info using [email protected] | linux | x64
│ gyp info ok
│ gyp info it worked if it ends with ok
│ gyp info using [email protected]
│ gyp info using [email protected] | linux | x64
│ gyp info find Python using Python version 3.10.12 found at "/usr/bin/python3"
│ gyp http GET https://nodejs.org/download/release/v23.1.0/node-v23.1.0-headers.tar.gz
│ gyp http 200 https://nodejs.org/download/release/v23.1.0/node-v23.1.0-headers.tar.gz
│ gyp http GET https://nodejs.org/download/release/v23.1.0/SHASUMS256.txt
│ gyp http 200 https://nodejs.org/download/release/v23.1.0/SHASUMS256.txt
│ gyp info spawn /usr/bin/python3
│ gyp info spawn args [
│ gyp info spawn args '/home/box/eliza/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 '/home/box/eliza/node_modules/@discordjs/opus/build/config.gypi',
│ gyp info spawn args '-I',
│ gyp info spawn args '/home/box/eliza/node_modules/node-gyp/addon.gypi',
│ gyp info spawn args '-I',
│ gyp info spawn args '/home/box/.cache/node-gyp/23.1.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/box/.cache/node-gyp/23.1.0',
│ gyp info spawn args '-Dnode_gyp_dir=/home/box/eliza/node_modules/node-gyp',
│ gyp info spawn args '-Dnode_lib_file=/home/box/.cache/node-gyp/23.1.0/<(target_arch)/node.lib',
│ gyp info spawn args '-Dmodule_root_dir=/home/box/eliza/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 [email protected]
│ gyp info using [email protected] | linux | x64
│ gyp ERR! build error
│ gyp ERR! stack Error: not found: make
│ gyp ERR! stack at getNotFoundError (/home/box/eliza/node_modules/which/lib/index.js:16:17)
│ gyp ERR! stack at which (/home/box/eliza/node_modules/which/lib/index.js:77:9)
│ gyp ERR! stack at async doWhich (/home/box/eliza/node_modules/node-gyp/lib/build.js:119:22)
│ gyp ERR! stack at async loadConfigGypi (/home/box/eliza/node_modules/node-gyp/lib/build.js:78:7)
│ gyp ERR! stack at async build (/home/box/eliza/node_modules/node-gyp/lib/build.js:36:3)
│ gyp ERR! stack at async run (/home/box/eliza/node_modules/node-gyp/bin/node-gyp.js:81:18)
│ gyp ERR! System Linux 5.15.153.1-microsoft-standard-WSL2
│ gyp ERR! command "/home/box/.nvm/versions/node/v23.1.0/bin/node" "/home/box/eliza/node_modules/no…
│ gyp ERR! cwd /home/box/eliza/node_modules/@discordjs/opus
│ gyp ERR! node -v v23.1.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 '/home/box/.nvm/versions/node/v23.1.0/bin/node /…
│ node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/box/eliza/node_modules/@discordjs/…
│ node-pre-gyp ERR! stack     at ChildProcess.emit (node:events:507: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.153.1-microsoft-standard-WSL2
│ node-pre-gyp ERR! command "/home/box/.nvm/versions/node/v23.1.0/bin/node" "/home/box/eliza/node_m…
│ node-pre-gyp ERR! cwd /home/box/eliza/node_modules/@discordjs/opus
│ node-pre-gyp ERR! node -v v23.1.0
│ node-pre-gyp ERR! node-pre-gyp -v v0.4.5
│ node-pre-gyp ERR! not ok
│ Failed to execute '/home/box/.nvm/versions/node/v23.1.0/bin/node /home/box/eliza/node_modules/nod…
└─ Failed in 4s at /home/box/eliza/node_modules/@discordjs/opus
node_modules/puppeteer: Running postinstall script...
node_modules/canvas: Running install script...
 ELIFECYCLE  Command failed with exit code 1.

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