0

I have a bash script that executes some node commands (node file.js). If there is an error in file.js is there a way to stop it going onto the terminal?

I have tried exec 2>/dev/null before the command

I have just entered characters into the script to produce an error to show the type of error I want to hide.

enter image description here

2
  • 1
    Perhaps you could use process.on('uncaughtException',...) stackoverflow.com/questions/7761475/… Commented Mar 21, 2017 at 20:44
  • Works great thanks :) Commented Mar 21, 2017 at 21:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.