我在 Win 8.1 x64 机器上。当我尝试运行生成的 Windows 二进制文件时,我收到一条 Windows 错误消息。
Windows 无法访问指定的设备、路径或文件。您可能没有适当的权限来访问该项目。
我试过的:
- 我已经检查了权限,我的 UAC 帐户已经完全控制了。
- 我从使用切换
electron-forge make
到electron-packager [folder] [projectTitle] --platform=win32 --arch=x64
(同样的错误) - 我更新了 npm、electron、electron-packager、electron-forge,并且有一次不得不在本地安装一系列包并在 dep 到 devdep 之间处理一些事情
- 特别是,我不得不将
electron
依赖项移至 devdeps 部分以满足electron-forge
- 将 .exe 复制到另一个文件夹,例如 e:\ 并尝试从那里运行它(同样的错误)
- 以管理员身份运行(同样的错误)
- 已更改
electronPackagerConfig.packageManager
为false
针对此最近已知的有关修剪失败的问题的推荐解决方法(与此问题无关,但它是一个因素) - 在 7zip 中打开两个 .exe 文件,发现生成的文件
electron-forge
内容不多。这可能没什么,也可能与该命令的控制台输出相关,如下所示。
我的目标:
这是我的第一个电子应用程序(我来自网络背景)。在我开始将我的应用程序与电子 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:
$
注意它似乎只是在那里切断了吗?我不知道,但我猜这很奇怪。
电子包装器。虚构数据库 --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
$
包.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"
}
}
}
}