Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
disnos9 opened this issue Nov 11, 2024 · 6 comments · May be fixed by #11769
Closed

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

disnos9 opened this issue Nov 11, 2024 · 6 comments · May be fixed by #11769
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@disnos9
Copy link

disnos9 commented Nov 11, 2024

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

> [email protected] 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

> [email protected] 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.

@disnos9 disnos9 added status: needs triage This issue needs to triage, applied to new issues type: bug labels Nov 11, 2024
@FabianLars
Copy link
Member

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

@disnos9
Copy link
Author

disnos9 commented Nov 11, 2024 via email

@LZQCN
Copy link

LZQCN commented Nov 15, 2024

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
Copy link
Author

disnos9 commented Nov 15, 2024

image

@LZQCN
Copy link

LZQCN commented Nov 15, 2024

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
Copy link
Author

disnos9 commented Nov 15, 2024

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

@disnos9 disnos9 closed this as completed Nov 15, 2024
FabianLars added a commit that referenced this issue Nov 21, 2024
fixes #11642
ref swc-project/swc#7965

i only added it for x64 for now but we should monitor x32 (swc removed it for this one again) and aarch64 (swc never added it).
x32 is fairly rare as a dev system and aarch64 didn't seem much testing in general (as a dev system) so i'd prefer to wait and see if it's needed.

note that i don't know if any other tooling (rust etc) need the dyn runtime so that's also something to monitor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants