我使用电子包装程序时遇到错误,我无法修复它

时间:2020-10-08 10:50:10

标签: node.js npm electron electron-packager

直到现在我仍然尝试做任何事情,我都遇到了相同的错误。我做了一些我在一些教程中看到的相同的事情,但是我却一遍又一遍地遇到这个错误。 我不知道这是什么问题,还有什么我可以尝试解决的。 我认为电子只是让人痛苦。

这是json文件:

{
  "name": "keypress",
  "version": "1.0.0",
  "description": "robotjs",
  "main": "main.js",
  "scripts": {
    "start": "electron .",
    "package-win": "electron-packager . keypress --overwrite --asar --platform=win32 --arch=x64 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName=\"keypress\""
  },
  "keywords": [
    "keypress"
  ],
  "author": "Cosmin",
  "license": "ISC",
  "devDependencies": {
    "electron": "^10.1.3",
    "electron-packager": "^15.1.0"
  },
  "dependencies": {
    "robotjs": "^0.6.0"
  }
}

这是调试日志:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\ionutvass\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'run',
1 verbose cli   'package-win'
1 verbose cli ]
2 info using npm@6.14.8
3 info using node@v12.19.0
4 verbose run-script [ 'prepackage-win', 'package-win', 'postpackage-win' ]
5 info lifecycle keypress@1.0.0~prepackage-win: keypress@1.0.0
6 info lifecycle keypress@1.0.0~package-win: keypress@1.0.0
7 verbose lifecycle keypress@1.0.0~package-win: unsafe-perm in lifecycle true
8 verbose lifecycle keypress@1.0.0~package-win: PATH: C:\Users\ionutvass\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\ionutvass\keypress\node_modules\.bin;C:\Python39\Scripts\;C:\Python39\;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Users\ionutvass\.windows-build-tools\python27\;C:\Users\ionutvass\AppData\Local\Microsoft\WindowsApps;C:\Users\ionutvass\AppData\Roaming\npm
9 verbose lifecycle keypress@1.0.0~package-win: CWD: C:\Users\ionutvass\keypress
10 silly lifecycle keypress@1.0.0~package-win: Args: [
10 silly lifecycle   '/d /s /c',
10 silly lifecycle   'electron-packager . keypress --overwrite --asar --platform=win32 --arch=x64 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName="keypress"'
10 silly lifecycle ]
11 silly lifecycle keypress@1.0.0~package-win: Returned: code: 1  signal: null
12 info lifecycle keypress@1.0.0~package-win: Failed to exec package-win script
13 verbose stack Error: keypress@1.0.0 package-win: `electron-packager . keypress --overwrite --asar --platform=win32 --arch=x64 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName="keypress"`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Users\ionutvass\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:314:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Users\ionutvass\AppData\Roaming\npm\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:314:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid keypress@1.0.0
15 verbose cwd C:\Users\ionutvass\keypress
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\ionutvass\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "package-win"
18 verbose node v12.19.0
19 verbose npm  v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error keypress@1.0.0 package-win: `electron-packager . keypress --overwrite --asar --platform=win32 --arch=x64 --icon=assets/icons/win/icon.ico --prune=true --out=release-builds --version-string.CompanyName=CE --version-string.FileDescription=CE --version-string.ProductName="keypress"`
22 error Exit status 1
23 error Failed at the keypress@1.0.0 package-win script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

0 个答案:

没有答案