首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >"Windows无法访问指定的.“..Exe由电子包装机或电子锻造制造

"Windows无法访问指定的.“..Exe由电子包装机或电子锻造制造
EN

Stack Overflow用户
提问于 2019-12-28 01:13:59
回答 1查看 1.3K关注 0票数 0

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

Windows无法访问指定的设备、路径或文件。您可能没有访问该项的适当权限。

我试过的是:

  • 我已经检查了权限,我的UAC帐户已经完全控制了。
  • 我从使用electron-forge make切换到electron-packager [folder] [projectTitle] --platform=win32 --arch=x64 (相同的错误)
  • 我更新了npm,电子,电子包装机,电子锻造,并且一度不得不在本地安装一系列的软件包,并从dep到devdep杂耍一些东西。
  • 特别是,为了满足electron,我不得不将electron-forge依赖项移到devdeps部分。
  • 将.exe复制到另一个文件夹,例如e:\,然后尝试从那里运行它(相同的错误)
  • 以管理员身份运行(相同错误)
  • 根据推荐的关于修剪失败的解决方案,将electronPackagerConfig.packageManager更改为false (与此问题无关,但这是其中的一个因素)
  • 在7zip中打开两个..exe,并注意到electron-forge生成的..exe没有太多内容。这可能不是什么,也可能与下面该命令的控制台输出相关。

我的目标是:

这是我的第一个电子应用程序(我来自一个网络背景)。在我开始将我的应用程序与电子的API显着地集成之前,我正在做这个构建作为一个健全检查。

命令输出

电子锻造

代码语言:javascript
复制
$ 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 32 --arch=x64

代码语言:javascript
复制
$ 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

代码语言:javascript
复制
{
  "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"
      }
    }
  }
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-12-28 02:47:09

我忘了关掉防病毒防护罩。修好了。(对于永久解决方案,我在防病毒应用程序的设置中添加了一个安全异常。)

令人感兴趣的是,电子锻造制作的版本不起作用:

然而,仅由electron-packager制作的那一款工作得很好。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59507391

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档