Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
众所周知,我们可以像这样在 elecron 中使用 shelljs:
const shelljs = require('shelljs') shelljs.config.execPath = shell.which('node').toString() shell.exec(`npm install`)
我试图立即终止这个漫长的任务,所以我这样做:
shell.exit(1)
结果就是整个electron进程都退出了……怎么在做事的时候停止shell。