tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[bug] PNPM, NPM & Yarn Panicked at 'Must load N-API Bindings'

Open coolguy1842 opened this issue 2 years ago • 4 comments

Describe the bug

Trying to create a tauri app or run tauri from a node package manager will output

../Local/pnpm/store/v3/tmp/dlx-21680 | +2 + Packages are copied from the content-addressable store to the virtual store. Content-addressable store is at: C:\Users\coolguy\AppData\Local\pnpm\store\v3 Virtual store is at: ../../../Users/coolguy/AppData/Local/pnpm/store/v3/tmp/dlx-21680/node_modules/.pnpm .../Local/pnpm/store/v3/tmp/dlx-21680 | Progress: resolved 11, reused 2, downloaded 0, added 2, done thread '' panicked at 'Must load N-API bindings', C:\Users\runneradmin.cargo\registry\src\index.crates.io-6f17d22bba15001f\napi-sys-2.2.3\src\functions.rs:7:3 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace  ERROR  Command failed with exit code 3221226505: create-tauri-app

at makeError (C:\Users\coolguy\AppData\Local\pnpm\global\5\.pnpm\[email protected]\node_modules\pnpm\dist\pnpm.cjs:24230:17)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.handler (C:\Users\coolguy\AppData\Local\pnpm\global\5\.pnpm\[email protected]\node_modules\pnpm\dist\pnpm.cjs:206486:7)
at async C:\Users\coolguy\AppData\Local\pnpm\global\5\.pnpm\[email protected]\node_modules\pnpm\dist\pnpm.cjs:215818:21
at async main (C:\Users\coolguy\AppData\Local\pnpm\global\5\.pnpm\[email protected]\node_modules\pnpm\dist\pnpm.cjs:215785:34)
at async runPnpm (C:\Users\coolguy\AppData\Local\pnpm\global\5\.pnpm\[email protected]\node_modules\pnpm\dist\pnpm.cjs:216040:5)
at async C:\Users\coolguy\AppData\Local\pnpm\global\5\.pnpm\[email protected]\node_modules\pnpm\dist\pnpm.cjs:216032:7

Reproduction

pnpm create tauri-app

Expected behavior

creates project

Platform and versions

Windows 10 x64 22H2
NodeJS v18.12.1
PNPM v8.2.0
NPM v8.19.2
Yarn v1.22.19

Stack trace

Nothing

Additional context

No response

coolguy1842 avatar Apr 12 '23 10:04 coolguy1842

I'm getting the same error when I'm running through MSYS2 (with MSYSTEM=CLANG64 and MSYS=winsymlinks:nativestrict), but it's working in PowerShell. I'm on Windows Server 2019 version 1809, PowerShell version 5.1.17763.2090.

lesderid avatar Apr 22 '23 14:04 lesderid

Looks like this is a Node version (or build configuration) issue. If I use my system Node.JS (v19.8.1) instead of the MSYS Node.JS (v18.15.0) it works fine.

lesderid avatar Apr 22 '23 15:04 lesderid

If I use my system Node.JS (v19.8.1) instead of the MSYS Node.JS (v18.15.0) it works fine.

Hey @lesderid! Do you mean you were using your system's Node.JS by somehow rewiring MSYS to use it?

Yoga07 avatar May 29 '23 13:05 Yoga07

If I use my system Node.JS (v19.8.1) instead of the MSYS Node.JS (v18.15.0) it works fine.

Hey @lesderid! Do you mean you were using your system's Node.JS by somehow rewiring MSYS to use it?

env PATH="/c/Program Files/nodejs/:$PATH" pnpm tauri dev

lesderid avatar May 29 '23 14:05 lesderid