【发布时间】:2020-03-30 08:09:26
【问题描述】:
我最近与 electron-builder 一起将我的 electronJS 应用程序更新到了更高版本。 我使用“npm start”运行应用程序没有问题,但是当我尝试使用 electron-builder 构建它时,运行“npm run dist”时出现以下错误:
$ npm run dist
myapp@1.0.0 dist C:\Projects\myapp 构建
'build' 不是内部或外部命令,可操作 程序或批处理文件。 npm 错误!代码 ELIFECYCLE npm 错误!错误号 1 npm 呃! myapp@1.0.0 dist:
buildnpm ERR!退出状态 1 npm ERR! npm 呃!在 myapp@1.0.0 dist 脚本中失败。 npm 错误!这大概是 npm 没问题。可能有额外的日志输出 以上。npm 错误!可以在以下位置找到此运行的完整日志:npm ERR!
C:\Users\User\AppData\Roaming\npm-cache_logs\2019-12-05T11_35_33_988Z-debug.log
package.json:
{
"name": "myapp",
"version": "1.1.0",
"description": "none",
"main": "main.js",
"scripts": {
"start": "electron .",
"dist": "build",
"postinstall": "electron-builder install-app-deps"
},
"build": {
"appId": "Myapp.com",
"asar": true,
"asarUnpack": [
"configuration/**/*",
"output/**/*",
"appdata/**/*",
"node_modules/easy-pdf-merge/**/*"
]
},
"repository": {
"type": "git",
"url": ""
},
"author": "",
"license": "ISC",
"homepage": "",
"dependencies": {
"axios": "^0.19.0",
"cryptr": "^6.0.1",
"easy-pdf-merge": "^0.2.0",
"edit-json-file": "^1.2.0",
"electron-log": "^3.0.9",
"electron-updater": "^4.2.0",
"eslint": "^5.12.0",
"exceljs": "^1.6.3",
"googleapis": "^27.0.0",
"mustache": "^3.0.1",
"node-localstorage": "^2.1.5",
"npm": "^6.5.0",
"pdf-table-extractor": "^1.0.3",
"popper.js": "^1.15.0",
"sqlite3": "^4.0.4",
"tippy.js": "^4.3.4",
"universal-analytics": "^0.4.20",
"uuid": "^3.3.3",
"webpack": "^4.28.0",
"winston": "^3.1.0"
},
"devDependencies": {
"electron": "^7.1.3",
"electron-builder": "^21.2.0"
}
}
节点版本:12.13.1 npm 版本:6.12.1
【问题讨论】:
标签: npm electron electron-builder