Failed to bootstrap path: path = /usr/bin/osascript

I have an *.pkg installer, and it calls osascript in the postinstall script.

I double clicked the installer to install my App, and most of the time it succeeded, except for this one:

On the Mac mini (late 2012, macOS 10.15.7), this installer got stuck at the postinstall stage. And I saw this in /var/log/system.log:

com.apple.xpc.launchd[1] (com.apple.xpc.launchd.domain.pid.osascript.6247): Failed to bootstrap path: path = /usr/bin/osascript, error = 2: No such file or directory

What does this mean? I'm pretty sure that /usr/bin/osascript does exist on the Mac.

I aborted the installation process and retried, the result was the same.

How to fix this?

Failed to bootstrap path: path = /usr/bin/osascript
 
 
Q