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] cli.win32-x64-msvc.node is not a valid Win32 application #5806

Closed
lvzhenbo opened this issue Dec 10, 2022 · 7 comments
Closed

[bug] cli.win32-x64-msvc.node is not a valid Win32 application #5806

lvzhenbo opened this issue Dec 10, 2022 · 7 comments
Labels
status: needs triage This issue needs to triage, applied to new issues type: bug

Comments

@lvzhenbo
Copy link

Describe the bug

yarn run v1.22.19
$ tauri
C:\Users\asus\Desktop\tauri-app\node_modules\@tauri-apps\cli\index.js:234
    throw loadError
    ^

Error: \\?\C:\Users\asus\Desktop\tauri-app\node_modules\@tauri-apps\cli-win32-x64-msvc\cli.win32-x64-msvc.node is not a valid Win32 application.
\\?\C:\Users\asus\Desktop\tauri-app\node_modules\@tauri-apps\cli-win32-x64-msvc\cli.win32-x64-msvc.node
    at Module._extensions..node (node:internal/modules/cjs/loader:1243:18)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (C:\Users\asus\Desktop\tauri-app\node_modules\@tauri-apps\cli\index.js:65:29)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v18.12.1
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Reproduction

jest run yarn run tauri

Expected behavior

can run

Platform and versions

PS C:\Users\asus\Desktop\tauri-app> npm run tauri info

> [email protected] tauri
> tauri info

C:\Users\asus\Desktop\tauri-app\node_modules\@tauri-apps\cli\index.js:234
    throw loadError
    ^

Error: \\?\C:\Users\asus\Desktop\tauri-app\node_modules\@tauri-apps\cli-win32-x64-msvc\cli.win32-x64-msvc.node is not a valid Win32 application.
\\?\C:\Users\asus\Desktop\tauri-app\node_modules\@tauri-apps\cli-win32-x64-msvc\cli.win32-x64-msvc.node
    at Module._extensions..node (node:internal/modules/cjs/loader:1243:18)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (C:\Users\asus\Desktop\tauri-app\node_modules\@tauri-apps\cli\index.js:65:29)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12) {
  code: 'ERR_DLOPEN_FAILED'
}

Node.js v18.12.1
PS C:\Users\asus\Desktop\tauri-app> cargo tauri info           

Environment
  › OS: Windows 10.0.22621 X64
  › Webview2: 108.0.1462.44
  › MSVC: 
      - Visual Studio Community 2022
  › Node.js: 18.12.1
  › npm: 8.19.2
  › pnpm: Not installed!
  › yarn: 1.22.19
  › rustup: 1.25.1
  › rustc: 1.65.0
  › cargo: 1.65.0
  › Rust toolchain: stable-x86_64-pc-windows-msvc 

Packages
  › @tauri-apps/cli [NPM]: 1.2.2
  › @tauri-apps/api [NPM]: 1.2.0
  › tauri [RUST]: 1.2.2,
  › tauri-build [RUST]: 1.2.1,
  › tao [RUST]: 0.15.7,
  › wry [RUST]: 0.23.3,

App
  › build-type: bundle
  › CSP: unset
  › distDir: ../dist
  › devPath: http://localhost:1420/
  › framework: Vue.js
  › bundler: Vite

App directory structure
  ├─ .git
  ├─ .history
  ├─ .vscode
  ├─ dist
  ├─ node_modules
  ├─ public
  ├─ src
  └─ src-tauri

Stack trace

No response

Additional context

No response

@lvzhenbo lvzhenbo added status: needs triage This issue needs to triage, applied to new issues type: bug labels Dec 10, 2022
@amrbashir
Copy link
Member

Can't seem to reproduce it locally, can you zip this project and upload it?

@lvzhenbo
Copy link
Author

Oh you reminded me, when I switched to npm to install the dependencies everything was fine, then I compared the npm download of cli.win32-x64-msvc.node with yarn's and found that the hash values were different, it seems that yarn downloaded the corrupted files or actively corrupted the files

@lvzhenbo
Copy link
Author

It's a yarn problem, nothing to do with tauri

@chakaponi
Copy link

Just install vc_redist

@wubolinha
Copy link

什么时候解决这个问题,我也遇到一样的问题。谢谢

@lvzhenbo
Copy link
Author

lvzhenbo commented May 5, 2024

什么时候解决这个问题,我也遇到一样的问题。谢谢

不是tauri自己的问题,是你包管理器下载包时候的问题,清理一下下载缓存再试试看

@hosseinmobarakian
Copy link

Hi, I just updated @tauri-apps/cli to the "^1.6.1" version. It is work for me.

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

No branches or pull requests

5 participants