oliverschwendener / ueli

Cross-Platform Keystroke Launcher
https://ueli.app
MIT License
3.46k stars 228 forks source link

[Bug?] v9: pnpm install fails #1102

Closed tkohlmeier closed 1 month ago

tkohlmeier commented 1 month ago

Describe the bug pnpm install fails with error cannot find prebuild-install

To Reproduce Steps to reproduce the behavior:

  1. Clone ueli repository
  2. Run pnpm install
  3. output:

    C:\git\ueli>pnpm install Lockfile is up to date, resolution step is skipped Already up to date

    ueli@9.0.0-beta.4 postinstall C:\git\ueli pnpm run rebuild

    ueli@9.0.0-beta.4 rebuild C:\git\ueli electron-builder install-app-deps

     • electron-builder  version=24.13.3
     • rebuilding native dependencies  dependencies=better-sqlite3@9.6.0 platform=win32 arch=x64
     • install prebuilt binary  name=better-sqlite3 version=9.6.0 platform=win32 arch=x64 napi=
     ⨯ cannot find prebuild-install
     ⨯ cannot execute  cause=fork/exec C:\Users\<username>\AppData\Roaming\npm\node_modules\pnpm\bin\pnpm.cjs: %1 is not a valid Win32 application.
                       command='C:\Users\<username>\AppData\Roaming\npm\node_modules\pnpm\bin\pnpm.cjs' rebuild better-sqlite3@9.6.0
                       workingDir=

    ELIFECYCLE  Command failed with exit code 1. ELIFECYCLE  Command failed with exit code 1.

Expected behavior The command should not fail.

Environment

Additional context Using node v22.2.0 and pnpm 9.1.2. When installing prebuild-install as a dev dependency it works.

oliverschwendener commented 1 month ago

Hmm, I can't reproduce this issue. I'm using node v20.12.2 and pnpm v9.1.2. Here is the output

$ pnpm install
Lockfile is up to date, resolution step is skipped
Already up to date

> ueli@9.0.0-beta.4 postinstall C:\Users\Oliver\projects\ueli
> pnpm run rebuild

> ueli@9.0.0-beta.4 rebuild C:\Users\Oliver\projects\ueli
> electron-builder install-app-deps

  • electron-builder  version=24.13.3
  • rebuilding native dependencies  dependencies=better-sqlite3@9.6.0 platform=win32 arch=x64
  • install prebuilt binary  name=better-sqlite3 version=9.6.0 platform=win32 arch=x64 napi=
Done in 1.9s
tkohlmeier commented 1 month ago

Do you have a folder prebuild-install in node_modules? I don't although the package is listed in pnpm-lock.yaml. Same error with node 20.

By the way: Why is node 22 listed as a requirement here?

oliverschwendener commented 1 month ago

By the way: Why is node 22 listed as a requirement here?

Oops, that's not inteded. I'll change it to node v20.

oliverschwendener commented 1 month ago

Do you have a folder prebuild-install in node_modules? I don't although the package is listed in pnpm-lock.yaml. Same error with node 20.

Yes, I have.

tkohlmeier commented 1 month ago

Interesting. That's probably why it works for you. Does it also work if you remove the node_modules folder before running pnpm install?

oliverschwendener commented 1 month ago

Yes. I have the same issue though in my Linux VM (using Ubuntu Cinnamon) where I do testing for Linux.

tkohlmeier commented 1 month ago

I found this issue on this topic, but even deleting the pnpm cache does not solve it for me. But since this seems to be a problem only on my machine and I have a workaround, I'll close this issue.

ke1v commented 3 weeks ago

I ran into the same issue on Linux Mint and updating the better-sqlite3 package to v10 seemed to fix the issue