tauri-apps / tauri

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

[bug] Can't run any Tauri CLI commands #11642

Closed disnos9 closed 1 week ago

disnos9 commented 2 weeks ago

Describe the bug

Brand new fresh install of Windows 10. Rust, Batch Tools (or C++ tools) are installed, Node.js is installed. File is there.

image

Happens on brand new Tauri instances (tested both with the npm creation script, and the PowerShell creation script) and a Tauri instance I downloaded over from my Mac (on a higher version that runs flawlessly)

Still occours even after removing all Node modules. Occours on latest node.js version. Node downloaded from the official Nodejs website.

Reproduction

Run any Tauri command under any enviornment. These will bring up the error:

npx run tauri dev npm run tauri dev tauri dev

Expected behavior

Expected Rust to compile the program and then open up my program.

Full tauri info output

PS C:\Users\dino\Desktop\iBallexus> npm run tauri info

> iballexus@0.1.0 tauri
> tauri info

C:\Users\dino\Desktop\iBallexus\node_modules\@tauri-apps\cli\index.js:312
    throw loadError
    ^

Error: The specified module could not be found.
\\?\C:\Users\dino\Desktop\iBallexus\node_modules\@tauri-apps\cli-win32-x64-msvc\cli.win32-x64-msvc.node
    at Module._extensions..node (node:internal/modules/cjs/loader:1460:18)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (C:\Users\dino\Desktop\iBallexus\node_modules\@tauri-apps\cli\index.js:76:29)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v18.20.4
PS C:\Users\dino\Desktop\iBallexus>

Stack trace

PS C:\Users\dino\Desktop\iBallexus> npm run tauri dev

> iballexus@0.1.0 tauri
> tauri dev

C:\Users\dino\Desktop\iBallexus\node_modules\@tauri-apps\cli\index.js:312
    throw loadError
    ^

Error: The specified module could not be found.
\\?\C:\Users\dino\Desktop\iBallexus\node_modules\@tauri-apps\cli-win32-x64-msvc\cli.win32-x64-msvc.node
    at Module._extensions..node (node:internal/modules/cjs/loader:1460:18)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12)
    at Module.require (node:internal/modules/cjs/loader:1231:19)
    at require (node:internal/modules/helpers:177:18)
    at Object.<anonymous> (C:\Users\dino\Desktop\iBallexus\node_modules\@tauri-apps\cli\index.js:76:29)
    at Module._compile (node:internal/modules/cjs/loader:1364:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1422:10)
    at Module.load (node:internal/modules/cjs/loader:1203:32)
    at Module._load (node:internal/modules/cjs/loader:1019:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v18.20.4
PS C:\Users\dino\Desktop\iBallexus>

Additional context

Fresh install of Windows 10. Bootcamp on Macbook Air 2015, Intel i5.

FabianLars commented 1 week ago

hmm, never seen this one before i think. Can you try it with a newer nodejs version maybe?

disnos9 commented 1 week ago

I tried everything the same way with Node.js versions v22 (latest), v20, and v18 (currently on)

Restarted my computer multiple times too.

On Mon, Nov 11, 2024 at 9:29 AM Fabian-Lars @.***> wrote:

hmm, never seen this one before i think. Can you try it with a newer nodejs version maybe?

— Reply to this email directly, view it on GitHub https://github.com/tauri-apps/tauri/issues/11642#issuecomment-2468312005, or unsubscribe https://github.com/notifications/unsubscribe-auth/A4QAU6PZUGGKOU4ZZJ4JUV32AC5NLAVCNFSM6AAAAABRQ5P3MSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINRYGMYTEMBQGU . You are receiving this because you authored the thread.Message ID: @.***>

LZQCN commented 1 week ago

When the error "The specified module could not be found" occurs, it is not due to the absence of cli.win32-x64-msvc.node. Instead, this error is generated by cli.win32-x64-msvc.node itself. The true implication of this error is that certain related DLLs are missing.

disnos9 commented 1 week ago

image

LZQCN commented 1 week ago

I performed a dependency analysis on the cli.win32-x64-msvc.node file using the following command:

C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.41.34120\bin\Hostx64\x64\dumpbin.exe /dependents cli.win32-x64-msvc.node

The output from the Microsoft COFF/PE Dumper is as follows:

Microsoft (R) COFF/PE Dumper Version 14.41.34123.0
Copyright (C) Microsoft Corporation.  All rights reserved.

Dump of file cli.win32-x64-msvc.node

File Type: DLL

  Image has the following dependencies:

    api-ms-win-core-synch-l1-2-0.dll
    bcryptprimitives.dll
    kernel32.dll
    shell32.dll
    ole32.dll
    bcrypt.dll
    advapi32.dll
    iphlpapi.dll
    ntdll.dll
    ws2_32.dll
    user32.dll
    userenv.dll
    shlwapi.dll
    oleaut32.dll
    VCRUNTIME140.dll
    api-ms-win-crt-math-l1-1-0.dll
    api-ms-win-crt-string-l1-1-0.dll
    api-ms-win-crt-runtime-l1-1-0.dll
    api-ms-win-crt-heap-l1-1-0.dll

  Summary

        6000 .data
       2C000 .pdata
      4DF000 .rdata
       19000 .reloc
      91A000 .text

The error message "The specified module could not be found" indicates that the cli.win32-x64-msvc.node module is missing a dependency. It appears that VCRUNTIME140.dll or the Windows Kits might be missing.

To resolve this issue, please ensure that the Visual C++ Redistributable for Visual Studio 2015 is installed on your system. This package includes the VCRUNTIME140.dll.

You can download the installer from the official Microsoft website: Visual C++ Redistributable for Visual Studio 2015.

After installing the redistributable, try running your Tauri CLI again.

disnos9 commented 1 week ago

Thank you so much my Tauri CLI works, huge thanks to you bro 🙏