Peon
Peon

Reputation: 8020

Electron Windows Store events.js throws Unhandled 'error' event

I'm trying to publish my app to the Windows 10 store, but getting errors, I can't seem to find the solutions to.

> 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! [email protected] appx: `node build-store.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] appx script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

The build-store files looks like this:

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())
  }
});

I found this and this similar question already, but they don't help at all. Also tried this suggestion, but didn't help.

Upvotes: 1

Views: 1125

Answers (2)

DrMaxB
DrMaxB

Reputation: 650

This is what helped me. When prompted to input your Windows SDK bin folder, don't put

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

You need to specify the folder for a particular version and architecture. Using

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

worked for me.

Upvotes: 1

Sravan
Sravan

Reputation: 18647

As you can see the error,

Error: spawn C:\Program Files (x86)\Windows Kits\10\bin\x64\makepri.exe ENOENT

It suggests that file does not exist at a specific place).

Make sure C:\\Program Files (x86)\\Windows Kits\\10\ is present in your folder

Also, check all the permissions associated to that folder.

Upvotes: 1

Related Questions