-
Notifications
You must be signed in to change notification settings - Fork 294
Closed
Description
- Node.js Version: 11.9.0
- OS: linux
- Scope (install, code, runtime, meta, other?):
- Module (and version) (if relevant):child_process.js
How should one consume UV_EACCES errors raised using spawn?
Assuming code like this:
const { spawn } = require('child_process');
const ls = spawn('ls', ['-lh', '/usr'],{cwd: '/dir/that/has/permissions/set/to666});
//next line throws an error because stdout does not exist due to UV_EACCES error:
ls.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
ls has an error event, but how should I access this before ls.stdout throws an error?
Metadata
Metadata
Assignees
Labels
No labels