electron-builder
Error: Unresolved node modules: bufferutil, utf-8-validate
Solution
Scheme 1
takeelectron-builder
Package upgrade to the latest version22.9.1
npm uninstall electron-builder
// or yarn remove electron-builder
npm i electron-builder -D
// or yarn add electron-builder -D
Scheme 2
download[email protected]put tonode_modules
Directory, and manually install the dependency
// node_modules/electron-builder
npm i
// or yarn
Scheme 3
Delete localelectron-builder
Use globalelectron-builder
To pack
// project
npm uninstall electron-builder
// or yarn remove electron-builder
npm i -g electron-builder
// or yarn add global http-server
Thinking of problem solving
Give a man a fish and you feed him for a day. Teach him how to fish and you feed him for a lifetime.
- Although the bug is given a lack of hints
bufferutil
,utf-8-validate
Two packages, but it’s actuallyapp-builder-lib
Package issues - When you try to install these two packages and still report the problem, we need to solve the person who raised the problem. After all, this is the fastest solution
- When you enter
app-builder-lib
It’s not hard to find it in the directory,app-builder-lib
Not in the catalogsrc
This catalog - So what should we do now? We should find other ways, such as
electron-builder
We can download the global package first and then package ityarn add global electron-builder
, and then executeelectron-builder --dir
To test a package, found that it can be packaged - Then the problem can be basically locked in the package dependency. The fastest solution is to use the latest package directly, but some projects can not use the latest package. What we should do is
- gonpmjsFind the corresponding package, and then
adoptRepository
Access to the packagegithub
Home page,
adopttags
Find the corresponding version of the package, download it and put it into thenode_modules
Directory, manually install the dependency to use
- At this point, you need to pay attention to the bags
package.json
Is the corresponding version in the same as the one you installed
- Finally, look at the corresponding documents to find out who raised the question
people
And then you can basically determine where the problem is (at present, the problem cannot be repeated in the future. After solving it, I tried to reproduce the problem, but found that20.19.2
In the absence of this problem, there is only a screenshot, which is also obtained from my partner) at presentwindows
useelectron
Generally speaking, the experience is not very good. The probability of persuading new people to quit is still very large. If you have any questions, please discuss them together
recommend
vue + electron
electron-vue
If you need to calldll
Or usewinax
A kind of package that needs to be compiled is still recommendedelectron-vue
At least you will encounter fewer problems. If you like challenges, recommend itvue-cli-plugin-electron-builder
vue-cli-plugin-electron-builder
If you just need onechrome
It is recommended that you use itvue-cli-plugin-electron-builder
At the same timevuetify
Use, the effect is better
For example, my open source project:weChatTool
Of course, I still like itvue-cli-plugin-electron-builder