账号密码登录
微信安全登录
微信扫描二维码登录

登录后绑定QQ、微信即可实现信息互通

手机验证码登录
找回密码返回
邮箱找回 手机找回
注册账号返回
其他登录方式
分享
  • 收藏
    X
    vue-cli项目中electron-builder打包提示app.asar does not exist如何处理?
    • 2020-01-01 00:00
    • 11
    31
    0

    vue-cli项目中electron-builder打包提示app.asar does not exist如何处理

    electron-builder出现错误

    相关代码

    package.json

    "name": "gushengwang",
    "version": "0.0.1",
    "description": "A Vue.js project",
    "author": "Wilson",
    "private": true,
    "scripts": {

    "dev": "webpack-dev-server --inline --progress --config build/webpack.dev.conf.js",
    "start": "npm run dev",
    "unit": "jest --config test/unit/jest.conf.js --coverage",
    "e2e": "node test/e2e/runner.js",
    "test": "npm run unit && npm run e2e",
    "lint": "eslint --ext .js,.vue src test/unit test/e2e/specs",
    "build": "node build/build.js",
    "electron_dev": "npm run build && electron build/electron.js",
    "electron_build": "electron-packager ./dist/ gushengwang --win --out ./myClient --arch=x64 --app-version=0.0.1 --overwrite",
    "dist": "electron-builder"

    },
    "builder": {

    "publish": [
        {
            "provider": "generic",
            "url": "https://localhost:8899/"   
        }
    ],
    "directories": {
        "output": "./myClient"  
    },
    "win": {    
        "target": [
            "nsis",  
            "zip"   
        ]
    },
    "nsis": {   
        "oneClick": false,    
        "allowToChangeInstallationDirectory": true,    
        "perMachine": true
    }

    }

    错误提示

    electron-builder

    • electron-builder version=20.43.0
    • writing effective config file=distbuilder-effective-config.yaml
    • no native production dependencies
    • packaging platform=win32 arch=x64 electron=5.0.3 appOutDir=distwin-unpacked
    Error: Application entry file "index.js" in the "C:UsersAdministratorDocumentsGitHubdesketopSystemGushengdistwin-unpackedresourcesapp.asar" does not exist. Seems like a wrong configuration.

    at error (C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\out\asar\asarFileChecker.js:44:14)
    at C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\asar\asarFileChecker.ts:30:4
    at Generator.next (<anonymous>)
    at C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\graceful-fs\polyfills.js:285:20
    at FSReqWrap.oncomplete (fs.js:154:5)

    From previous event:

    at _checkFileInArchive (C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\asar\asarFileChecker.ts:36:17)
    at checkFileInArchive (C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\out\asar\asarFileChecker.js:40:30)
    at C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\platformPackager.ts:409:13
    at Generator.next (<anonymous>)

    From previous event:

    at WinPackager.checkFileInPackage (C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\platformPackager.ts:406:110)
    at C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\platformPackager.ts:460:16
    at Generator.next (<anonymous>)
    at C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\graceful-fs\polyfills.js:285:20
    at FSReqWrap.oncomplete (fs.js:154:5)

    From previous event:

    at WinPackager.sanityCheckPackage (C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\platformPackager.ts:446:92)
    at C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\platformPackager.ts:249:16
    at Generator.next (<anonymous>)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)

    From previous event:

    at WinPackager.doPack (C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\platformPackager.ts:167:165)
    at C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\platformPackager.ts:113:16
    at Generator.next (<anonymous>)

    From previous event:

    at WinPackager.pack (C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\platformPackager.ts:111:95)
    at C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\packager.ts:430:24
    at Generator.next (<anonymous>)
    at xfs.stat (C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\node_modules\fs-extra\lib\mkdirs\mkdirs.js:56:16)
    at C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\graceful-fs\polyfills.js:285:20
    at FSReqWrap.oncomplete (fs.js:154:5)

    From previous event:

    at Packager.doBuild (C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\packager.ts:396:24)
    at C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\packager.ts:366:57
    at Generator.next (<anonymous>)
    at C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\graceful-fs\graceful-fs.js:111:16
    at C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\graceful-fs\graceful-fs.js:45:10
    at FSReqWrap.args [as oncomplete] (fs.js:140:20)

    From previous event:

    at Packager._build (C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\packager.ts:335:133)
    at C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\packager.ts:331:23
    at Generator.next (<anonymous>)
    at runCallback (timers.js:705:18)
    at tryOnImmediate (timers.js:676:5)
    at processImmediate (timers.js:658:5)

    From previous event:

    at Packager.build (C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\packager.ts:288:14)
    at build (C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\app-builder-lib\src\index.ts:59:28)
    at build (C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\electron-builder\src\builder.ts:228:10)
    at then (C:\Users\Administrator\Documents\GitHub\desketopSystemGusheng\node_modules\electron-builder\src\cli\cli.ts:49:19)

    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! gushengwang@0.0.1 dist: electron-builder
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the gushengwang@0.0.1 dist script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

    npm ERR! A complete log of this run can be found in:
    npm ERR! C:UsersAdministratorAppDataRoamingnpm-cache_logs2019-06-14T01_44_34_858Z-debug.log

    0
    打赏
    收藏
    点击回答
    您的回答被采纳后将获得:提问者悬赏的 11 元积分
        全部回答
    • 0
    更多回答
    扫一扫访问手机版

    回答动态

    师傅被妖怪抓走了:发布了悬赏问题火爆全网的“元宇宙”到底是什么?预计能赚取 1积分收益
    酒后略带风情:发布了悬赏问题Android内存中Graphics与Code占用过高预计能赚取 10积分收益
    扛起拖把扫天下:发布了悬赏问题typescript如何导出接口配置?求解,谢谢!预计能赚取 10积分收益
    发布了悬赏问题Vue 如何改变返回页面的路径?如让B页面只能返回到A页面.预计能赚取 11积分收益
    发布了悬赏问题vue H5移动端;底部bottom固定定位,安卓弹起键盘导致页面变形如何解决?预计能赚取 10积分收益
    发布了悬赏问题请问为什么tomcat8.5 GET请求中文正常,POST请求还需要设置UTF-8.预计能赚取 10积分收益
    发布了悬赏问题vue2.5+ts创建以及引入jq的方法预计能赚取 11积分收益
    情场浪女:发布了悬赏问题import ggplot时报错module 'pandas' has no attribute 'tslib'预计能赚取 10积分收益
    见心书画许老师18753375161:发布了悬赏问题echarts3 legend禁止点击事件,允许悬浮事件预计能赚取 11积分收益
    aa_92cb0bd09f:发布了悬赏问题codewar上的一个问题预计能赚取 11积分收益