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

怎样安装类似serialport的插件 #595

Open
4 tasks done
kerwinxu opened this issue Aug 21, 2024 · 0 comments
Open
4 tasks done

怎样安装类似serialport的插件 #595

kerwinxu opened this issue Aug 21, 2024 · 0 comments

Comments

@kerwinxu
Copy link

Describe the bug

我通过如下的方式创建项目

yarn create @quick-start/electron

创建完成后只修改了 electron.vite.config.mjs

  main: {
    plugins: [externalizeDepsPlugin({exclude:['serialport']})]
  },

然后运行
yarn add serialport
出现如下的错误

electron-builder install-app-deps
  • electron-builder  version=24.13.3
  • loaded configuration  file=C:\Users\kerwin\Desktop\新建文件夹\com_helper\electron-builder.yml
  • rebuilding native dependencies  dependencies=@serialport/[email protected] platform=win32 arch=x64
  • rebuilding native dependency  name=@serialport/bindings-cpp version=12.0.1
  ⨯ cannot execute  cause=fork/exec C:\Users\kerwin\.yarn\releases\yarn-1.22.19.cjs: %1 is not a valid Win32 application.
                    command='C:\Users\kerwin\.yarn\releases\yarn-1.22.19.cjs' run install
                    workingDir=C:\Users\kerwin\Desktop\新建文件夹\com_helper\node_modules\@serialport\bindings-cpp
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

我想知道,类似这类c++库,应该怎么安装?我看了样例。

Electron-Vite Version

electron-vite/2.3.0 win32-x64 node-v20.16.0

Electron Version

v32.0.0

Vite Version

vite/5.4.2 win32-x64 node-v20.16.0

Validations

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant