"Windows cannot access the specified..." .exe 由 electron-packager 或 electron-forge 制作

"Windows cannot access the specified..." .Exe's made by electron-packager nor electron-forge

我在 Win 8.1 x64 机器上。当我尝试 运行 生成的 Windows 二进制文件时,我收到一条 Windows 错误消息。

Windows cannot access the specified device, path, or file. You may not have the appropriate permissions to access the item.

我尝试过的:

我的目标:

这是我的第一个electron app(我是web出身)。在我开始将我的应用程序与 Electron 的 API.

显着集成之前,我正在做这个构建作为健全性检查

命令输出

电子锻造

$ electron-forge make
We need to package your application before we can make it
[BABEL] Note: The code generator has deoptimised the styling of "E:/cygwin64/tmp/electron-packager/win32-x64/fictionDB-win32-x64/resources/app/.tmp/public/js/ckeditor/ckeditor.js" as it exceeds the max of "500KB".
[BABEL] Note: The code generator has deoptimised the styling of "E:/cygwin64/tmp/electron-packager/win32-x64/fictionDB-win32-x64/resources/app/.tmp/public/js/jquery-ui/jquery-ui.js" as it exceeds the max of "500KB".
Making for the following targets:

$

注意它似乎只是在那里被切断了吗?我不知道,但我猜这很奇怪。

电子包装商。 fictionDB --platform=win32 --arch=x64

$ electron-packager . fictionDB --platform=win32 --arch=x64
Downloading tmp-50796-1-SHASUMS256.txt-7.1.7
[============================================>] 100.0% of 5.56 kB (5.56 kB/s)
Packaging app for platform win32 x64 using electron v7.1.7
Wrote new app to E:\xxx\Documents\src\js_src\Projects\testbed6\fictionDB-win32-x64

$

package.json

{
  "name": "fictionDB",
  "private": false,
  "version": "0.0.0",
  "description": "A way for fiction writers to plan & organize",
  "keywords": [
    "organize",
    "database",
    "fiction",
    "novel",
    "stories",
    "characters",
    "events",
    "locations",
    "settings"
  ],
  "dependencies": {
    "@sailshq/connect-redis": "^3.2.1",
    "@sailshq/lodash": "^3.10.3",
    "@sailshq/socket.io-redis": "^5.2.0",
    "acorn": "^7.1.0",
    "ckeditor": "^4.12.1",
    "connect-redis": "^4.0.3",
    "electron-compile": "^6.4.4",
    "electron-squirrel-startup": "^1.0.0",
    "grunt": "^1.0.4",
    "jquery": "^3.4.1",
    "jquery-ui-dist": "^1.12.1",
    "lodash": "^4.17.15",
    "request": "^2.88.0",
    "sails": "^1.2.3",
    "sails-hook-grunt": "^4.0.1",
    "sails-hook-orm": "^2.1.1",
    "sails-hook-sockets": "^2.0.0",
    "socket.io-redis": "^5.2.0"
  },
  "devDependencies": {
    "babel-plugin-transform-async-to-generator": "^6.24.1",
    "babel-preset-env": "^1.7.0",
    "babel-preset-react": "^6.24.1",
    "electron": "^7.1.7",
    "electron-forge": "^5.2.4",
    "electron-prebuilt-compile": "4.0.0",
    "eslint": "5.16.0"
  },
  "scripts": {
    "start": "electron-forge start",
    "test": "npm run lint && npm run custom-tests && echo 'Done.'",
    "lint": "./node_modules/eslint/bin/eslint.js . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'",
    "custom-tests": "echo \"(No other custom tests yet.)\" && echo",
    "package": "electron-forge package",
    "make": "electron-forge make"
  },
  "main": "app/launch.js",
  "repository": {
    "type": "git",
    "url": "git://github.com/NathanHawks/FictionDB.git"
  },
  "author": "Nathan Hawks",
  "license": "MIT",
  "engines": {
    "node": "^8.9"
  },
  "config": {
    "forge": {
      "make_targets": {
        "win32": [
          "squirrel"
        ],
        "darwin": [
          "zip"
        ],
        "linux": [
          "deb",
          "rpm"
        ]
      },
      "electronPackagerConfig": {
        "packageManager": false
      },
      "electronWinstallerConfig": {
        "name": "fictionDB"
      },
      "electronInstallerDebian": {},
      "electronInstallerRedhat": {},
      "github_repository": {
        "owner": "",
        "name": ""
      },
      "windowsStoreConfig": {
        "packageName": "",
        "name": "fictionDB"
      }
    }
  }
}

我忘了关闭防病毒盾牌。那修好了。 (对于永久解决方案,我随后在防病毒应用程序的设置中添加了安全例外。)

请注意,electron-forge 制作的版本不起作用:

不过,electron-packager一个人做的,效果还不错。