Файл заблокирован кодом - PullRequest
0 голосов
/ 20 апреля 2019

Когда я использую пакет electron-builder для создания своего электронного приложения, vs code выдает ошибку:

 ⨯ remove D:\project\Shorthands_PC\build\win-unpacked\resources\app.asar: The process cannot access the file because it is being used by another process.
github.com/develar/go-fs-util.EnsureEmptyDir
        /Volumes/data/go/pkg/mod/github.com/develar/go-fs-util@v2.0.1-0.20181113101504-f6630ccc0e93+incompatible/fs.go:101
github.com/develar/app-builder/pkg/electron.unpackElectron.func1.1
        /Volumes/data/Documents/app-builder/pkg/electron/electronUnpack.go:39
github.com/develar/app-builder/pkg/util.MapAsyncConcurrency.func2
        /Volumes/data/Documents/app-builder/pkg/util/async.go:67
runtime.goexit
        /usr/local/Cellar/go/1.12/libexec/src/runtime/asm_amd64.s:1337

Error: D:\project\Shorthands_PC\node_modules\app-builder-bin\win\x64\app-builder.exe exited with code 1
    at ChildProcess.childProcess.once.code (D:\project\Shorthands_PC\node_modules\builder-util\src\util.ts:244:14)
    at Object.onceWrapper (events.js:273:13)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:961:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:248:5)
From previous event:
    at _unpack (D:\project\Shorthands_PC\node_modules\app-builder-lib\out\electron\ElectronFramework.js:298:18)
    at unpack (D:\project\Shorthands_PC\node_modules\app-builder-lib\out\electron\ElectronFramework.js:257:18)
    at ElectronFramework.prepareApplicationStageDirectory (D:\project\Shorthands_PC\node_modules\app-builder-lib\src\electron\ElectronFramework.ts:125:12)
    at D:\project\Shorthands_PC\node_modules\app-builder-lib\src\platformPackager.ts:180:21
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.doPack (D:\project\Shorthands_PC\node_modules\app-builder-lib\src\platformPackager.ts:167:165)
    at D:\project\Shorthands_PC\node_modules\app-builder-lib\src\platformPackager.ts:113:16
    at Generator.next (<anonymous>)
From previous event:
    at WinPackager.pack (D:\project\Shorthands_PC\node_modules\app-builder-lib\src\platformPackager.ts:111:95)
    at D:\project\Shorthands_PC\node_modules\app-builder-lib\src\packager.ts:430:24
    at Generator.next (<anonymous>)
    at xfs.stat (D:\project\Shorthands_PC\node_modules\fs-extra-p\node_modules\fs-extra\lib\mkdirs\mkdirs.js:56:16)
    at D:\project\Shorthands_PC\node_modules\graceful-fs\polyfills.js:285:20
    at FSReqWrap.oncomplete (fs.js:159:5)
From previous event:
    at Packager.doBuild (D:\project\Shorthands_PC\node_modules\app-builder-lib\src\packager.ts:396:24)
    at D:\project\Shorthands_PC\node_modules\app-builder-lib\src\packager.ts:366:57
    at Generator.next (<anonymous>)
    at D:\project\Shorthands_PC\node_modules\graceful-fs\graceful-fs.js:111:16
    at D:\project\Shorthands_PC\node_modules\graceful-fs\graceful-fs.js:45:10
    at FSReqWrap.oncomplete (fs.js:145:20)
From previous event:
    at Packager._build (D:\project\Shorthands_PC\node_modules\app-builder-lib\src\packager.ts:335:133)
    at D:\project\Shorthands_PC\node_modules\app-builder-lib\src\packager.ts:331:23
    at Generator.next (<anonymous>)
    at runCallback (timers.js:696:18)
    at tryOnImmediate (timers.js:667:5)
    at processImmediate (timers.js:649:5)
From previous event:
    at Packager.build (D:\project\Shorthands_PC\node_modules\app-builder-lib\src\packager.ts:288:14)
    at build (D:\project\Shorthands_PC\node_modules\app-builder-lib\src\index.ts:59:28)
    at build (D:\project\Shorthands_PC\node_modules\electron-builder\src\builder.ts:228:10)
    at then (D:\project\Shorthands_PC\node_modules\electron-builder\src\cli\cli.ts:46:19)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Shorthands_PC@1.0.0 build: `node .Shorthands_PC/build.js && electron-builder`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Shorthands_PC@1.0.0 build 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:\Users\guoxiaoshen\AppData\Roaming\npm-cache\_logs\2019-04-20T13_14_41_734Z-debug.log

Я не могу найти никакого решения, кроме закрытия vs кода.Я не знаю, если это ошибка.

версия:

против кода: 1.33.1

os: Windows_NT x64 10.0.17763

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...