[英]How can I run another command after running a server in a shell script?
I want to run another command after running a Node.js server from a shell script on an Ubuntu box, but the second command never launch.在从 Ubuntu 框上的 shell 脚本运行 Node.js 服务器后,我想运行另一个命令,但第二个命令永远不会启动。
node server.js
xdg-open index.html
How can i fix it?我该如何解决?
You can add into start in package.json
>>您可以在package.json
中添加开始>>
{
"name": "example",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node server.js && xdg-open index.html"
},
"dependencies": {
},
"devDependencies": {
}
}
and run with npm start并使用npm 开始运行
see: npm script参见: npm 脚本
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.