Exec command not found
See original GitHub issue- Version: 17.21.0
- Target: dmg
I have some exec()
command in my app for example:
exec('npm -v', (err, stdout, stderr) => {
$log.info(stdout, stderr, err);
});
It works if i start the app from the shell but it won’t if i build the dmg and install the app.
I get error in console: npm command not found
So i tried this:
require('child_process').execSync('which npm').toString();
And i get this error:
child_process.js:538 Uncaught Error: Command failed: which npm
at checkExecSyncError (child_process.js:495:13)
at Object.execSync (child_process.js:535:13)
at Object.childProcess.(anonymous function) [as execSync] (ELECTRON_ASAR.js:690:22)
at <anonymous>:1:26
Any advice?
Thank you
Issue Analytics
- State:
- Created 7 years ago
- Comments:11 (6 by maintainers)
Top Results From Across the Web
exec command not found error in Linux - Unix Stack Exchange
@VeeraV The issue is that on your system, cd is not available as an external utility, while pwd is. The exec utility is...
Read more >Bash exec command not found - Stack Overflow
Bash exec command not found · Because exec expects the first argument to be the name of a command, not the whole command...
Read more >How to fix a "Command not found" error in Linux - Red Hat
5 ways to fix "Command not found" errors · 1. Include the path · 2. Add a new path · 3. Copy a...
Read more >Linux / UNIX: Command Not Found Error and Solution - nixCraft
It means either program is not installed or PATH variable in your environment is not pointing to it. Learn how to fix command...
Read more >Command not found error while running exec command on ...
I am trying this- kubectl exec -it examplepod -n namespacename-ci -- /bin/bash. I get bash-4.4 I enter sudo su after it which I...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Actually i found that using this:
process.env.PATH = process.env.PATH + ':/usr/local/bin';
exec works, could be a fix or it’s going to take me to the hell too? 🗡
No, I suggest https://github.com/electron-userland/electron-builder/issues/880#issuecomment-258601786