-
Notifications
You must be signed in to change notification settings - Fork 152
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
node-serialport is not working #42
Comments
need to externalize import { resolve } from 'path'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()]
},
preload: {
plugins: [externalizeDepsPlugin()]
},
//...
}) use Learm more about https://evite.netlify.app/guide/build.html#externals |
app can be launched now, but when
• electron-builder version=23.6.0 |
Pada tanggal Sel, 25 Okt 2022 08.25, stalkercn ***@***.***>
menulis:
… app can be launched now, but when npm i is ran, there's still an error.
electron-builder install-app-deps
• electron-builder version=23.6.0
• loaded configuration file=C:\git\electron-app\electron-builder.yml
• rebuilding native dependencies
***@***.******@***.*** platform=win32 arch=x64
⨯ cannot execute cause=fork/exec
C:\Users\Administrator\AppData\Roaming\npm\node_modules\pnpm\bin\pnpm.cjs:
%1 is not a valid Win32 application.
command='C:\Users\Administrator\AppData\Roaming\npm\node_modules\pnpm\bin\pnpm.cjs'
rebuild @***@***.***
workingDir=
ELIFECYCLE Command failed with exit code 1.
—
Reply to this email directly, view it on GitHub
<#42 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/A2Z4L6ULDSBYD6NES3IREI3WE4ZJJANCNFSM6AAAAAARM422AU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
@stalkercn May be some problem in |
this works. |
Describe the bug
When node-serialport lib is imported, error occurred.
Node Version: 16.18.0
Node-SerialPort Version: 10.4.0
Electron Version: 20.3.3
Vite Version: 3.1.8
Electron-Vite Version: 1.0.11
Reproduction:
install node-serialport
npm i serialport
code in main/index.ts:
import { SerialPort } from serialport; console.log(SerialPort)
run electron-vite
Electron-Vite Version
1.0.11
Electron Version
20.3.3
Vite Version
3.1.8
Validations
The text was updated successfully, but these errors were encountered: