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

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

Open
CaoRuimiao opened this issue May 16, 2024 · 7 comments
Labels

Comments

@CaoRuimiao
Copy link

CaoRuimiao commented May 16, 2024

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
Copy link
Contributor

Maybe try this #1949 (comment)

@CaoRuimiao
Copy link
Author

Maybe try this #1949 (comment)

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

@ifurther
Copy link
Contributor

ifurther commented Jun 9, 2024

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

@PengDaDaDa
Copy link

PengDaDaDa commented Jun 18, 2024

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

@18715672252
Copy link

我也遇到了

@18715672252
Copy link

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

  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

Copy link
Contributor

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants