tauri-apps / tauri

Build smaller, faster, and more secure desktop applications with a web frontend.
https://tauri.app
Apache License 2.0
79.46k stars 2.36k forks source link

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

Open edimoldovan opened 1 year ago

edimoldovan commented 1 year ago

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:

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

edimoldovan commented 1 year ago

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

FabianLars commented 1 year ago

Did you say yes when the script asked if you want to install the node cli? (We should change it up a bit since it's required now)

edimoldovan commented 1 year ago

Yes, I did.

lucasfernog commented 1 year ago

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.

Michael-Reich commented 1 year ago

I have the same issue and I'm on a Intel CPU

robertlagrant commented 1 year ago

I hit this but on Linux, in a CI build:

$ npm i
added 848 packages in 19s
146 packages are looking for funding
  run `npm fund` for details
$ npm run tauri.build
> our-package@0.0.0 tauri.build
> tauri build
/builds/...../our-package/node_modules/@tauri-apps/cli/index.js:234
    throw loadError
    ^
Error: Cannot find module '@tauri-apps/cli-linux-x64-gnu'

The npm run tauri.build command is defined as tauri build in my package.json.

NiklasEi commented 1 year ago

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.

zhanglun commented 1 year ago

I also encountered this problem on Mac M1 Pro after upgrade OS version to Ventura.

KStephening commented 1 year ago

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

KStephening commented 1 year ago

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

the image from nvm. https://github.com/nvm-sh/nvm

zhanglun commented 1 year ago

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
bkrmendy commented 12 months ago

Upgrading to node v16.17.0 (lts/gallium) from node v14.20.0 (lts/fermium) fixed it for me.

JPAGhosn commented 11 months ago

If you are migrating from Mac M1 to x86 device, you'll need to delete the package-lock.json and node_modules then run npm i again to reinstall all the dependencies.

deid84 commented 11 months ago

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

Kottakji commented 3 months ago

I've had this problem in CI, and added the following to fix it:

      - name: Install frontend dependencies
        run: npm install

      - name: Install Tauri cli
        run: npm install --save-dev @tauri-apps/cli
kjxbyz commented 2 months ago

same issue.

link