[英]How to return to terminal execution after running node fileName.js command?
I have a shell script as : 我有一个shell脚本:
node fileName.js
echo "done";
exit 0;
my fileName.js : 我的fileName.js:
console.log("script executed");
Now after running node fileName.js
command, the terminal is not executing commands after it ie echo "done"; exit 0;
现在,在运行
node fileName.js
命令之后,终端将不执行命令,即echo "done"; exit 0;
echo "done"; exit 0;
So How can I return the control to terminal after executing node js file. 那么执行节点js文件后如何将控件返回到终端。
It works fine: 它工作正常:
a.js : a.js:
console.log("from node")
a.sh : a.sh:
#/bin/bash
node a.js
echo "from bash";
exit 0;
output : bash a.sh 输出:bash a.sh
from node
from bash
You can try to add a process.exit(0) at the end of your node filename 您可以尝试在节点文件名的末尾添加process.exit(0)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.