npm 电子Windows应用商店events.js引发未处理的“错误”事件

z2acfund  于 2022-11-24  发布在  Windows
关注(0)|答案(2)|浏览(177)

我尝试将我的应用发布到Windows 10应用商店,但遇到错误,我似乎找不到解决方案。

> node build-store.js

Configuration:
Desktop Converter Location:    false
Expanded Base Image:           false
Publisher:                     CN=******************
Dev Certificate:               C:\data\certs\devcert.pfx
Windows Kit Location:          C:\Program Files (x86)\Windows Kits\10\bin\x64

Starting Conversion...
Cleaning pre-appx output folder...
Copying data...
Creating manifest..
Creating priconfig...
events.js:186
      throw er; // Unhandled 'error' event
      ^

Error: spawn C:\Program Files (x86)\Windows Kits\10\bin\x64\makepri.exe ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:270:12)
    at onErrorNT (internal/child_process.js:456:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64\\makepri.exe',
  path: 'C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64\\makepri.exe',
  spawnargs: [
    'createconfig',
    '/cf',
    'pre-appx\\priconfig.xml',
    '/dq',
    'en-US',
    '/a'
  ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-armory-app@1.3.0 appx: `node build-store.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-armory-app@1.3.0 appx script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

构建存储文件如下所示:

const convertToWindowsStore = require('electron-windows-store');

convertToWindowsStore({
  containerVirtualization: false,
  inputDirectory: 'C:\\data\\PRIVATE\\my-armory-app',
  outputDirectory: 'C:\\data\\PRIVATE\\my-armory-app-APPX',
  packageVersion: '1.3.0',
  packageName: 'My Armory App',
  packageDisplayName: 'My Armory App',
  deploy: false,
  publisher: 'CN=***************',
  windowsKit: 'C:\\Program Files (x86)\\Windows Kits\\10\\bin\\x64',
  devCert: 'C:\\data\\certs\\devcert.pfx',
  certPass: '**********',
  makeappxParams: ['/l'],
  signtoolParams: ['/p'],
  makePri: true,
  createConfigParams: ['/a'],
  createPriParams: ['/b'],
  finalSay: function () {
    return new Promise((resolve, reject) => resolve())
  }
});

我已经找到了thisthis类似的问题,但它们根本没有帮助。还尝试了this建议,但没有帮助。

lvjbypge

lvjbypge1#

如您所见,
错误:生成C:\程序文件(x86)\Windows工具包\10\bin\x64\makepri.exe ENOENT
它表明文件不存在于特定的地方)。
确保文件夹中存在C:\\Program Files (x86)\\Windows Kits\\10\
此外,请检查与该文件夹关联的所有权限。

6kkfgxo0

6kkfgxo02#

这对我很有帮助。当提示输入Windows SDK bin文件夹时,不要将

C:\Program Files (x86)\Windows Kits\10\bin

您需要为特定版本和体系结构指定文件夹。

C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64

对我有用。

相关问题