首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >电子- WinInstaller

电子- WinInstaller
EN

Stack Overflow用户
提问于 2019-02-12 20:37:17
回答 1查看 763关注 0票数 0

我试图为我的电子计算机应用程序创建一个windows安装程序,但是当我运行该文件时,出现了以下错误:

代码语言:javascript
复制
spawn mono ENOENT
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! thermowell-design@1.2.0 installer-win: `npm run pack-win && node installers/windows/createinstaller.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the thermowell-design@1.2.0 installer-win script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

这是createinstaller.js文件:

代码语言:javascript
复制
const createWindowsInstaller = require('electron-winstaller').createWindowsInstaller
const path = require('path')

getInstallerConfig()
  .then(createWindowsInstaller)
  .catch((error) => {
    console.error(error.message || error)
    process.exit(1)
  })

function getInstallerConfig () {
  console.log('creating windows installer')
  const rootPath = path.join('./')
  const outPath = path.join(rootPath, 'release-builds')

  return Promise.resolve({
    appDirectory: path.join(outPath, 'Thermowell-Design-win32-x64/'),
    authors: 'Pippo',
    noMsi: true,
    outputDirectory: path.join(outPath, 'windows-installer'),
    exe: 'thermowell-design.exe',
    setupExe: 'thermowell-design-app.exe',
    setupIcon: path.join(rootPath, 'assets', 'images', 'icons', 'logo.ico')
  })
}

有可靠的版本:

  1. 电子:5.0.0-β.2,
  2. 电子包装机: 13.0.1,
  3. 电子收割机: 2.7.0

最后,nodejs版本是10.15.1

EN

回答 1

Stack Overflow用户

发布于 2019-05-14 13:01:38

现在回答已经太晚了,但如果将来有人需要的话,就留给他们吧。我也遇到了同样的问题,下面是我的解决办法:

  1. 根据我的项目结构,我更改了rootPath = path.join(__dirname,‘./..’)
  2. https://www.mono-project.com/download/stable/#download-lin-ubuntu安装mono
  3. https://tecadmin.net/install-wine-on-ubuntu/安装葡萄酒如果您为windows平台构建安装程序,则两个安装都是针对非windows平台的。

这些都是我的修补程序,但这里有另一个可能对您有帮助的链接

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54658346

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档