本文介绍: 找到 node_module/app–builder–lib/out/targets/nsis/NsisTarget.js文件,在 executeMakensis 方法中加入相应的代码,include: could not find: “C:Usersxxxx(这里是中文)AppDataLocalTempt-TH3KzB-messages.nsh”//添加下面这一行即可。
Error output:
2 !include: could not find: "C:Usersxxxx(这里是中文)AppDataLocalTempt-TH3KzB-messages.nsh"
3 Error in script "<stdin>" on line 75 -- aborting creation process
这个报错意思是路径有中文存在,解析不到,完整的错误显示如下:
Error output:
!include: could not find: “C:Usersxxxx(这里是中文)AppDataLocalTempt-TH3KzB-messages.nsh”
Error in script “” on line 75 – aborting creation process
at ChildProcess.<anonymous> (D:electron-learingelectron-record-learnrecord-projectnode_modulesbuilder-utilsrcutil.ts:250:14)
at Object.onceWrapper (node:events:642:26) sbuilder-utilsrcutil.ts:250:14)
at ChildProcess.emit (node:events:527:28)
at ChildProcess.cp.emit (D:electron-learingelectron-record-learnrecord-projectnode_modulescross-spawnlibenoent.js:34:29)
at maybeClose (node:internal/child_process:1092:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:302:5) {
exitCode: 1,
alreadyLogged: false,
code: ‘ERR_ELECTRON_BUILDER_CANNOT_EXECUTE’
}
把编译出来的乱码用utf-8来编译:
找到 node_module/app–builder-lib/out/targets/nsis/NsisTarget.js文件,在 executeMakensis 方法中加入相应的代码,
async executeMakensis(defines, commands, script) {
const args = this.options.warningsAsErrors === false ? [] : ["-WX"];
//添加下面这一行即可
args.push("-INPUTCHARSET", "UTF8");
for (const name of Object.keys(defines)) {
const value = defines[name];
if (value == null) {
args.push(`-D${name}`);
} else {
args.push(`-D${name}=${value}`);
}
}
}
原文地址:https://blog.csdn.net/carry_666/article/details/134674874
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_33564.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。