steelbrain / steelbrain/node-ssh
Error when executing command with streaming stdout/stderr callbacks
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 1k
- Forks
- 94
- PR merge metrics
- No merged PRs in 30d
Description
Sample code
ssh.connect(sshOptions).then(function() {
Utils.formatLogs(hostname, "SSH comamnd : " + commandToExecute)
ssh.exec(commandToExecute, {
onStdout(chunk: any) {
console.log('stdoutChunk', chunk.toString('utf8'));
},
onStderr(chunk: any) {
console.log('stderrChunk', chunk.toString('utf8'));
throw chunk.toString('utf8');
}
});
});
Error
TypeError: a.forEach is not a function
at shellescape (E:\GithubNew<user>\node_modules\shell-escape\shell-escape.js:7:5)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the ssh.exec call shown in the issue and trace how its command arguments reach shell-escape, including the reported node_modules/shell-escape/shell-escape.js failure. Reproduce the streaming stdout/stderr callback example and determine the expected argument shape; done means the example executes without the TypeError.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js, typescript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100