grunt watch task block the command line

前端 未结 5 1239
天涯浪人
天涯浪人 2021-02-05 12:36

I\'m new to grunt, still learning, so I came up to a very strange problem. When I run \"watch\" task, my command line becomes blocked, so basically I cant do anythi

5条回答
  •  时光取名叫无心
    2021-02-05 13:07

    I havn't used grunt watch, however I believe the problem is that it is a continuously running process, and by default your command line will typically run one process at a time. There are 3 solutions you can use.

    1. Open a new terminal. You can have multiple open at once, and this will allow you to use the second as your main terminal while grunt watch occupies the other.
    2. Use the & symbol in your command. This will begin the process and immediately return the command line to you, allowing you to use it for other things. You can think of it as running the command in the background. The process is still connected to the terminal window, so if you close the window, the process will end.

      grunt w &

    3. Use ( &) around your command. This will run in the background the same as just &, however the process will not be killed when you close the terminal window.

      (grunt w &)

提交回复
热议问题