出于某种原因,电子包装商无法找到电子......知道该怎么办吗?

For some reason, electron-packager is not able to find electron... Any idea what to do?

由于某种原因,electron-packager 找不到模块 electron。我已经按照官方网站的说明安装了它,但它似乎不起作用。这是似乎发生的事情,我的 package.json,以及我如何 运行 electron-packager

Package.json

{
"name": "electron-part1",
"version": "1.0.0",
"description": "An electron tutorial",
"main": "index.js",
"jquery": "^3.3.1",
"scripts": {
    "start": "electron .",
    "test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Me",
"license": "ISC",
"devDependencies": {
    "electron": "^5.0.3",
    "electron-packager": "^8.7.2"
},
"dependencies": {
    "custom-electron-titlebar": "^3.2.5",
    "jquery": "^3.5.1"
}
}

发生了什么:

我如何称呼 electron-packager: 电子包装商。电子部分1 --platform=win32 --arch=x64

我修好了!如果其他人遇到同样的问题,请从 %USERPROFILE%\AppData\Roaming\npm\node_modules 复制 electron,并将其粘贴到主文件夹中的节点模块(带有 package.json 的那个),然后您可以正常打包它