electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.46k stars 1.71k forks source link

本地调试检测更新没有问题,打包成功后,安装electron应用时提示Cannot find module 'electron-updater' #8220

Open CaoRuimiao opened 1 month ago

CaoRuimiao commented 1 month ago

Cannot find module 'electron-updater' after build

"dependencies": {
    "electron-log": "^5.1.4",
    "electron-updater": "6.1.8"
},
"devDependencies": {
    "electron": "^27.0.2",
    "electron-builder": "^22.9.1"
},

有人遇到吗?该怎么解决?

ifurther commented 1 month ago

Maybe try this https://github.com/electron-userland/electron-builder/issues/1949#issuecomment-585622204

CaoRuimiao commented 1 month ago

Maybe try this #1949 (comment)

在我的package.json配置中electron-updater是在dependencies下面呢,没太明白该怎么处理。 刚刚试了下按照您的回复中的版本安装后,本地启动报错: Uncaught Exception: Error: Cannot find module ‘fs/promises'

ifurther commented 3 weeks ago

You will use the English to show the problem, and it will let more people help you.

PengDaDaDa commented 2 weeks ago

delete "!node_modules" from files in package.json. image

18715672252 commented 5 days ago

我也遇到了

18715672252 commented 5 days ago

我解决了,不知道会不会对你有用

  1. 项目根目录新建.npmrc文件 2.在文件中(.npmrc)加入node-linker=hoisted 3.删除node_modules文件 4.使用npm i 重新下载依赖(一定要使用npm下载依赖)

下面是我的版本号 "dependencies": { "@electron-toolkit/utils": "^3.0.0", "axios": "^1.6.8", "electron-is-dev": "^3.0.1", "form-data": "^4.0.0", "electron-updater": "^6.2.1" }

"devDependencies": { "electron": "^30.0.4", "electron-builder": "^24.13.3" }

node 19.9.0 npm 9.6.3