I have an installer built in "Packages" tool. While installing getting "Couldn't postix_spawn: error 2" message. Could you please help me to fix this issue?
[请查看以下installer.log文件以获取更多详细信息]
PackageKit: ----- Begin install -----
Feb 13 12:49:12 asutos-mac installd[465]: PackageKit: request=PKInstallRequest <1 packages, destination=/>
Feb 13 12:49:12 asutos-mac installd[465]: PackageKit: packages=( "PKLeopardPackage <file://localhost/Users/efi/Desktop/FCC/OSX/FieryColorCloud.pkg#FieryColorCloud.pkg>")
Feb 13 12:49:15 asutos-mac installd[465]: PackageKit: Extracting file://localhost/Users/efi/Desktop/FCC/OSX/FieryColorCloud.pkg#FieryColorCloud.pkg (destination=/var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/C/PKInstallSandboxManager/692B6502-401B-46BD-ADB6-F1E52BFA3115.activeSandbox/Root, uid=0)
Feb 13 12:49:22 asutos-mac installd[465]: PackageKit: prevent user idle system sleep
Feb 13 12:49:22 asutos-mac installd[465]: PackageKit: suspending backupd
Feb 13 12:49:22 asutos-mac installd[465]: PackageKit: Using trashcan path /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/T/PKInstallSandboxTrash/692B6502-401B-46BD-ADB6-F1E52BFA3115.sandboxTrash for sandbox /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/C/PKInstallSandboxManager/692B6502-401B-46BD-ADB6-F1E52BFA3115.activeSandbox
Feb 13 12:49:22 asutos-mac installd[465]: PackageKit: Shoving /var/folders/zz/zyxvpxvq6csfxvn_n0000000000000/C/PKInstallSandboxManager/692B6502-401B-46BD-ADB6-F1E52BFA3115.activeSandbox/Root (2 items) to /
Feb 13 12:49:22 asutos-mac install_monitor[20439]: Temporarily excluding: /Applications, /Developer, /Library, /System, /bin, /private, /sbin, /usr
Feb 13 12:49:22 asutos-mac install_monitor[20439]: PackageKit: Locking applications
Feb 13 12:49:22 asutos-mac installd[465]: PackageKit: Executing script "./postinstall" in /private/tmp/PKInstallSandbox.ZLdi87/Scripts/com.efi.FieryColorCloud.3qlsuM
Feb 13 12:49:22 asutos-mac installd[465]: ******PackageKit: *** Couldn't posix_spawn: error 2******
Feb 13 12:49:23 asutos-mac install_monitor [20439]:重新包含:/ Applications,/ Developer,/ Library,/ System,/ bin,/ private,/ sbin,/ usr 2月13日12:49:23 asutos-mac installd [465]:PackageKit:release backupd 2月13日12:49:23 asutos-mac installd [465]:PackageKit:允许用户空闲系统休眠 2月13日12:49:23 asutos-mac installd [465]:PackageKit:安装失败:错误域= PKInstallErrorDomain代码= 112“从包”FieryColorCloud.pkg“运行脚本时发生错误。” UserInfo = {NSFilePath =。/ postinstall,NSURL = file://localhost/Users/efi/Desktop/FCC/OSX/FieryColorCloud.pkg#FieryColorCloud.pkg,PKInstallPackageIdentifier = com.efi.FieryColorCloud,NSLocalizedDescription =运行时出错来自“FieryColorCloud.pkg”包的脚本。} { NSFilePath =“./ posttinstall”; NSLocalizedDescription =“从程序包\ U201cFieryColorCloud.pkg \ U201d运行脚本时发生错误。”; NSURL =“file://localhost/Users/efi/Desktop/FCC/OSX/FieryColorCloud.pkg#FieryColorCloud.pkg”; PKInstallPackageIdentifier =“com.efi.FieryColorCloud”; } 2月13日12:49:23 asutos-mac installd [465]:PackageKit:运行空闲任务 2月13日12:49:23 asutos-mac installer [20435]:install:didFailWithError:Error Domain = PKInstallErrorDomain Code = 112“从包”FieryColorCloud.pkg“运行脚本时发生错误。” UserInfo = {NSFilePath =。/ postinstall,NSURL = file://localhost/Users/efi/Desktop/FCC/OSX/FieryColorCloud.pkg#FieryColorCloud.pkg,PKInstallPackageIdentifier = com.efi.FieryColorCloud,NSLocalizedDescription =运行时出错来自“FieryColorCloud.pkg”包的脚本。} 2月13日12:49:23 asutos-mac installd [465]:PackageKit:删除客户端PKInstallDaemonClient pid = 20435,uid = 0(/ usr / sbin / installer) 2月13日12:49:23 asutos-mac installd [465]:PackageKit:完成沙箱删除 2月13日12:49:24 asutos-mac installer [20435]:安装失败:安装程序遇到导致安装失败的错误。请与软件制造商联系以获取帮助。
答案 0 :(得分:0)
errno=2
在macOS上是ENOENT
。
这可能是由#引起的!指令,用于启动后安装脚本,该脚本指定目标系统上不存在的程序。您应该验证软件包中的postinstall脚本是否指定了系统上存在的解释器的完整路径。
答案 1 :(得分:0)
也许,您的shell脚本中可能有问题(很可能是关于“哈希爆炸”,即#!指令)。
尝试以下步骤:
对于每个preinstall / postinstall脚本:
一种。将整个脚本内容复制到除#!之外的新文件(例如preinstall_new / postinstall_new)中。指示。
b。在preinstall_new / postinstall_new文件顶部键入#!/ bin / bash或正在使用的其他解释器(请勿复制,使用键盘写)。
C。将preinstall_new / postinstall_new文件设置为可执行文件(chmod +x preinstall_new
)
d。用新创建的preinstall_new / postinstall_new脚本文件(mv preinstall_new preinstall
)替换原始的preinstall / postinstall脚本
触发构建并验证安装程序。