Javascript Can';不要用CTRL+停止吞咽;C

Javascript Can';不要用CTRL+停止吞咽;C,javascript,macos,gulp,Javascript,Macos,Gulp,我正在运行gulp的一个项目,我在终端中得到: crsjopgp6444:promo-llove-your-app-2 berretan$ gulp [14:14:39] Using gulpfile ~/Documents/Projects/promo-llove-your-app-2/gulpfile.js [14:14:39] Starting 'assemble'... [14:14:39] Starting 'sass'... [14:14:40] Starting 'fonts'..

我正在运行gulp的一个项目,我在终端中得到:

crsjopgp6444:promo-llove-your-app-2 berretan$ gulp
[14:14:39] Using gulpfile ~/Documents/Projects/promo-llove-your-app-2/gulpfile.js
[14:14:39] Starting 'assemble'...
[14:14:39] Starting 'sass'...
[14:14:40] Starting 'fonts'...
[14:14:40] Starting 'notify:server'...
[14:14:40] Finished 'fonts' after 197 ms
[14:14:41] gulp-notify: [Gulp notification] Server ready!
[14:14:41] Finished 'notify:server' after 244 ms
[14:14:41] Finished 'assemble' after 2.04 s
当我尝试用CTRL+C停止项目时,我不允许,它只是不做任何事情,我必须关闭选项卡并在新的选项卡中打开它

在浏览器中,我在我选择的端口9000中看不到任何东西,我看到的只是:

无法访问此网站

本地主机拒绝连接

在谷歌搜索localhost 9000

我正在使用节点5.5.0的El Capitan


有什么建议吗?

虽然这是一个老问题,但它仍然会在谷歌上弹出。下面是我在使用nodemon时的最终效果:

var monitor = $.nodemon(...)
// Make sure we can exit on Ctrl+C
process.once('SIGINT', function() {
monitor.once('exit', function() {
      console.log('Closing gulp');
      process.exit();
    });
});
monitor.once('quit', function() {
    console.log('Closing gulp');
    process.exit();
});
我从你那儿得到的

如果您没有使用nodemon,也可以使用:

process.on('SIGINT', function() {
  setTimeout(function() {
    process.exit(1);
  }, 500);
});

虽然这是一个老问题,但它仍然会在谷歌出现。下面是我在使用nodemon时的最终效果:

var monitor = $.nodemon(...)
// Make sure we can exit on Ctrl+C
process.once('SIGINT', function() {
monitor.once('exit', function() {
      console.log('Closing gulp');
      process.exit();
    });
});
monitor.once('quit', function() {
    console.log('Closing gulp');
    process.exit();
});
我从你那儿得到的

如果您没有使用nodemon,也可以使用:

process.on('SIGINT', function() {
  setTimeout(function() {
    process.exit(1);
  }, 500);
});

您可以添加您的“大口”配置吗?如果不能使用CTRL+C停止bash进程,这意味着您的计算机无法正确停止正在运行的进程。这可能是由很多事情引起的:-/@NietzscheProgrammer关于Ctrl+D的情况如何?你能添加你的gulp配置吗?如果不能使用CTRL+C停止bash进程,这意味着您的计算机无法正确停止正在运行的进程。这可能是由很多事情引起的:-/@NietzscheProgrammer那么Ctrl+D呢?????