tauri: Cannot find module '@tauri-apps/cli-darwin-x64'

HI!

I tried running the examples/aåpi the way the documention says to. I am getting this

`yarn tauri dev yarn run v1.22.19 warning package.json: No license field warning …/…/…/…/…/package.json: No license field $ node …/…/tooling/cli/node/tauri.js dev /Users/ed/dev/rust/tauri/tooling/cli/node/index.js:234 throw loadError ^

Error: Cannot find module ‘@tauri-apps/cli-darwin-x64’ Require stack:

  • /Users/ed/dev/rust/tauri/tooling/cli/node/index.js
  • /Users/ed/dev/rust/tauri/tooling/cli/node/main.js
  • /Users/ed/dev/rust/tauri/tooling/cli/node/tauri.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15) at Function.Module._load (internal/modules/cjs/loader.js:746:27) at Module.require (internal/modules/cjs/loader.js:974:19) at require (internal/modules/cjs/helpers.js:93:18) at Object.<anonymous> (/Users/ed/dev/rust/tauri/tooling/cli/node/index.js:111:29) at Module._compile (internal/modules/cjs/loader.js:1085:14) at Object.Module._extensions…js (internal/modules/cjs/loader.js:1114:10) at Module.load (internal/modules/cjs/loader.js:950:32) at Function.Module._load (internal/modules/cjs/loader.js:790:12) at Module.require (internal/modules/cjs/loader.js:974:19) { code: ‘MODULE_NOT_FOUND’, requireStack: [ ‘/Users/ed/dev/rust/tauri/tooling/cli/node/index.js’, ‘/Users/ed/dev/rust/tauri/tooling/cli/node/main.js’, ‘/Users/ed/dev/rust/tauri/tooling/cli/node/tauri.js’ ] } error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`

I’m on a Mac M1 Pro, latest MacOS Ventura.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 18 (3 by maintainers)

Most upvoted comments

I had the same issue on Linux and seem to have fixed it by deleting the package-lock.json file, removing node_modules and running npm i again.

you can install higher version of node . I use nvm manage node. By use higher version of node ,I can BUILD . @edimoldovan @zhanglun image

I’m on Node v20.18.0 and i was trying to run the tauri examples, precisely the api example, none of the above solutions worked.

What i did was delete the references to the @tauri-apps/cli and @tauri-apps/api and just added them with pnpm i @tauri-apps/api pnpm i -D @tauri-apps/cli The newer version takes care of using the corresponding architechture

Hello, I solved same problem by downgrading node version from 20.14.0 to 18.17.0.

hello, i have the same problem, if i try to install on windows works smoothly but on a x86 mac it installs api and cli but not find cli-darwin-x64. Even if i copy the folder from another project it works until the next npm install

you can install higher version of node . I use nvm manage node. By use higher version of node ,I can BUILD . @edimoldovan @zhanglun image

still not work for me. But I solved it with:

cd src-tauri
cargo clean
cargo build

Kinda weird that it’s trying to find @tauri-apps/cli-darwin-x64 instead of @tauri-apps/cli-darwin-arm64 (or ./cli.darwin-arm64.node when you build it locally).

What is the output of $ node -p "process.arch"? From the error message it’ll print x64, which is not your actual architecture (should actually print arm64). Maybe you’re running a Rosetta Node.js? Try reinstalling Node.

Checking further, I think none of the examples that need yarn or node to run are working.