Node Child Process Exec Command Failed with error code 1

Shan Khan

I am trying to execute some line using node js child process and getting error. Following is my code:

let cmd : string = "code " + PROJECTS[value];
exec(cmd, function callback(error, stdout, stderr) {
  console.log("started console app");
});

ERROR :

cmd:"C:\WINDOWS\system32\cmd.exe /s /c "code c:\Users\shana\Dropbox\code-settings-syn... (length: 82)"
code:1
killed:false
message:"Command failed: C:\WINDOWS\system32\cmd.exe /s /c "code c:\Users\shana\Dropbox\c... (length: 99)"
signal:null
stack:undefined

Detail of error JSON.

Full CMD : "C:\WINDOWS\system32\cmd.exe /s /c "code c:\Users\shana\Dropbox\code-settings-sync""
Full message : "Command failed: C:\WINDOWS\system32\cmd.exe /s /c "code c:\Users\shana\Dropbox\code-settings-sync"\n"
Nabeel Hassan

try a simpler example ..

var exec = require('child_process').exec;
var cmd = 'code C:\Program Files';
exec(cmd, function(err, stdout, stderr) {
if (err) {
console.error(err);
return;
}
console.log(stdout); 
});

does this work??

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to resolve the error while executing top command using node child_process.exec?

From Dev

NodeJS Child Process EXEC Command Failed with NVM Permission denied OSX

From Dev

how to use a "&" in node.js child_process exec command?

From Dev

Cordova - Error code 1 for command | Command failed for

From Dev

How to access command line arguments in a node.js child process using child_process.exec?

From Dev

Linker command failed with exit code 1 error

From Dev

AWS Glue: Command failed with error code 1

From Dev

Node-Webkit Child Process Exec

From Dev

Multiple child_process exec on node js

From Dev

Change the code from child process exec to spawn

From Dev

error ~node_modules/node-sass: Command failed Exit code: 1 Command: node scripts/build.js when running rails new application

From Dev

What happens to the child process, when the parent process calls an exec command

From Dev

node child process jasmine error

From Dev

Compile Error: linker command failed with exit code 1

From Dev

Swift: error: linker command failed with exit code 1

From Dev

clang: error: linker command failed with exit code 1 (Xcode 8.2.1)

From Dev

Cordova - Error: cmd: Command failed with exit code 1

From Dev

Starting mongod fork, ERROR: child process failed, exited with error number 1

From Dev

Using child_process.exec to send a command returning 404

From Dev

How to run mongodump command in spawn/exec child process with arguments

From Dev

Stdout of Node.js child_process exec is cut short

From Dev

Stdout of Node.js child_process exec is cut short

From Dev

Node child process exec async only called once

From Dev

build failed with error 'file not found' and 'linker command failed with exit code 1 '

From Java

How to promisify Node's child_process.exec and child_process.execFile functions with Bluebird?

From Dev

Node: child_process.exec() process continuing after parent process dies

From Dev

MongoDB: ERROR: child process failed, exited with error number 14

From Dev

Code Sign Error - Command /usr/bin/codesign failed with exit code 1

From Dev

command/usr/bin/codesign failed with exit code 1- code sign error

Related Related

  1. 1

    How to resolve the error while executing top command using node child_process.exec?

  2. 2

    NodeJS Child Process EXEC Command Failed with NVM Permission denied OSX

  3. 3

    how to use a "&" in node.js child_process exec command?

  4. 4

    Cordova - Error code 1 for command | Command failed for

  5. 5

    How to access command line arguments in a node.js child process using child_process.exec?

  6. 6

    Linker command failed with exit code 1 error

  7. 7

    AWS Glue: Command failed with error code 1

  8. 8

    Node-Webkit Child Process Exec

  9. 9

    Multiple child_process exec on node js

  10. 10

    Change the code from child process exec to spawn

  11. 11

    error ~node_modules/node-sass: Command failed Exit code: 1 Command: node scripts/build.js when running rails new application

  12. 12

    What happens to the child process, when the parent process calls an exec command

  13. 13

    node child process jasmine error

  14. 14

    Compile Error: linker command failed with exit code 1

  15. 15

    Swift: error: linker command failed with exit code 1

  16. 16

    clang: error: linker command failed with exit code 1 (Xcode 8.2.1)

  17. 17

    Cordova - Error: cmd: Command failed with exit code 1

  18. 18

    Starting mongod fork, ERROR: child process failed, exited with error number 1

  19. 19

    Using child_process.exec to send a command returning 404

  20. 20

    How to run mongodump command in spawn/exec child process with arguments

  21. 21

    Stdout of Node.js child_process exec is cut short

  22. 22

    Stdout of Node.js child_process exec is cut short

  23. 23

    Node child process exec async only called once

  24. 24

    build failed with error 'file not found' and 'linker command failed with exit code 1 '

  25. 25

    How to promisify Node's child_process.exec and child_process.execFile functions with Bluebird?

  26. 26

    Node: child_process.exec() process continuing after parent process dies

  27. 27

    MongoDB: ERROR: child process failed, exited with error number 14

  28. 28

    Code Sign Error - Command /usr/bin/codesign failed with exit code 1

  29. 29

    command/usr/bin/codesign failed with exit code 1- code sign error

HotTag

Archive