umbrella22 / electron-vite-template

This project is a vue3 + Vite + electron project template composed of Vite and rollup. It has the same functions as my previous electron+Vue+template project
Other
418 stars 111 forks source link

目前遇到了两个问题 #112

Closed GeZiOrk closed 4 months ago

GeZiOrk commented 1 year ago

第一次yarn安装完依赖以后 执行yarn第二次的时候会报错,
报错步骤,下载master最新的代码

  1. yarn
  2. yarn add sqlite 提示错误 C:\acode\electron-vite-template-main\node_modules\cliui\build\index.cjs:291 const stringWidth = require('string-width'); ^ Error [ERR_REQUIRE_ESM]: require() of ES Module C:\acode\electron-vite-template-main\node_modules\string-width\index.js from C:\acode\electron-vite-template-main\node_modules\cliui\build\index.cjs not supported. Instead change the require of index.js in C:\acode\electron-vite-template-main\node_modules\cliui\build\index.cjs to a dynamic import() which is available in all CommonJS modules. at Object. (C:\acode\electron-vite-template-main\node_modules\cliui\build\index.cjs:291:21) at Object. (C:\acode\electron-vite-template-main\node_modules\yargs\build\index.cjs:1:60678) at Object. (C:\acode\electron-vite-template-main\node_modules\yargs\index.cjs:5:30) at Object. (C:\acode\electron-vite-template-main\node_modules\electron-builder\out\builder.js:7:15) at Object. (C:\acode\electron-vite-template-main\node_modules\electron-builder\out\cli\cli.js:11:19) at Object. (C:\acode\electron-vite-template-main\node_modules\electron-builder\cli.js:4:1) error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

经过我不断的尝试后发现,删除yarn.lock 再执行yarn add sqlite 就不报错了

GeZiOrk commented 1 year ago

还有一个问题就是,运行electron程序以后, Developer Tools的右键我一开始以为没反映 经过我比较刁钻的角度右键以后发现,右键菜单在窗口后面,被挡住了,点不到,不知道是不是新版electron的bug?

GeZiOrk commented 1 year ago

不知道我们现在有没有交流群,可以拉一下我吗

GeZiOrk commented 1 year ago

我当前Node版本 v18.17.0 yarn -v 1.22.19 最新版的node 20+我也测试过了也有这些问题

umbrella22 commented 1 year ago
  1. electron-builder的部分依赖导致该问题,使用npm则没有该问题
  2. Developer Tools的右键是指。。?
GeZiOrk commented 1 year ago

image 蓝色的部分是在窗口后面的,我在win10和win11的电脑都会有这种情况

GeZiOrk commented 1 year ago

@umbrella22 大佬 问题1的这个问题在后续会修复吗

umbrella22 commented 1 year ago

1要等上游依赖,这个我也没法控制

l8oo8l commented 1 year ago

他说的第一个问题,我也遇到了,我也是发现移除yarn.lock重新加入依赖就没了 我看说的解决方案是要改为npm吗?不能用yarn?

umbrella22 commented 1 year ago

@l8oo8l 用npm吧,yarn的话,奇奇怪怪的问题有点多