rebuild icon indicating copy to clipboard operation
rebuild copied to clipboard

Fails to build package on Windows

Open PalmerAL opened this issue 4 years ago • 1 comments

I'm trying to build keytar inside my Electron project in combination with Electron-packager, and I've configured my packaging script as described in the readme:

var baseOptions = {
  name: 'Min',
  dir: basedir,
  out: 'dist/app',
  electronVersion: electronVersion,
  appVersion: version,
  arch: 'all',
  ignore: ignoredDirs,
  prune: true,
  overwrite: true,
  afterCopy: [(buildPath, electronVersion, platform, arch, callback) => {
    rebuild({ buildPath, electronVersion, arch })
      .then(() => callback())
      .catch((error) => callback(error))
  }]
}

If I run this on macOS, it works, but on Windows (10 2004), I get the following error:

gyp: C:\Users\User\AppData\Local\Temp\electron-packager\win32-ia32\Min-win32-ia32\resources\app\node_modules\keytar\10.0.0\common.gypi not found (cwd: C:\Users\User\AppData\Local\Temp\electron-packager\win32-ia32\Min-win32-ia32\resources\app\node_modules\keytar) while reading includes of binding.gyp while trying to load binding.gyp

If I run npm rebuild directly in the repository, however, everything finishes successfully, so I'm assuming the actual node-gyp environment is set up correctly.

Is there anything else I can try to make rebuild work successfully?

PalmerAL avatar Nov 12 '20 04:11 PalmerAL

Actually, it works if I limit the package architectures to only the machine architecture (x64). So I guess this may be a general node-gyp issue after all - is there anything else that needs to be installed to make cross-architecture builds work?

PalmerAL avatar Nov 12 '20 05:11 PalmerAL