salmon-match-99387
02/10/2023, 1:24 PMpulumi version --non-interactive
by hand works just fine.
I got python based examples work, so it seems that the issue is somehow related to nodejs. Running macos.
./node_modules/ts-node/dist/bin.js index.ts
❯ ./node_modules/ts-node/dist/bin.js index.ts
CommandError: code: -2
stdout:
stderr: Command failed with ENOENT: pulumi version --non-interactive
spawn /bin/sh ENOENT
err?: Error: Command failed with ENOENT: pulumi version --non-interactive
spawn /bin/sh ENOENT
at Object.createCommandError (/Users/massive/code/provisioner/provisioner/node_modules/@pulumi/automation/errors.ts:75:27)
at Object.<anonymous> (/Users/massive/code/provisioner/provisioner/node_modules/@pulumi/automation/cmd.ts:79:15)
at Generator.throw (<anonymous>)
at rejected (/Users/massive/code/provisioner/provisioner/node_modules/@pulumi/pulumi/automation/cmd.js:19:65)
at processTicksAndRejections (node:internal/process/task_queues:95:5) {
commandResult: CommandResult {
stdout: '',
stderr: 'Command failed with ENOENT: pulumi version --non-interactive\n' +
'spawn /bin/sh ENOENT',
code: -2,
err: Error: Command failed with ENOENT: pulumi version --non-interactive
spawn /bin/sh ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
at onErrorNT (node:internal/child_process:476:16)
at processTicksAndRejections (node:internal/process/task_queues:82:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /bin/sh',
path: '/bin/sh',
spawnargs: [Array],
originalMessage: 'spawn /bin/sh ENOENT',
shortMessage: 'Command failed with ENOENT: pulumi version --non-interactive\n' +
'spawn /bin/sh ENOENT',
command: 'pulumi version --non-interactive',
escapedCommand: 'pulumi version --non-interactive',
exitCode: undefined,
signal: undefined,
signalDescription: undefined,
stdout: '',
stderr: '',
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
}
}
workDir
attribute pointing to a invalid directory. Fixing that got the script working.
The error message was quite wild, because it had nothing to do with the actual problem.