node.js - 运行“watch_default”任务等待

时间:2018-04-17 09:18:12

标签: node.js gruntjs

在终端中

1. grunt ,显示:

enter image description here

然后我按照终端推荐,

首先,运行grunt build --env uat,然后运行成功。

之后,运行grunt watch --evn uat,但在Running "watch_default" task步骤中,显示等待,但不会进入下一步。 enter image description here

我尝试运行grunt test,为我显示此错误。 enter image description here

我试图在谷歌搜索,但仍然没有一个很好的解决方案来解决这个问题。

这是参考:

1。[Watch] Waiting... never OK #474

2。Grunt watch Running “watch” task Waiting

3。Trying to run a Grunt watch task but it just says Waiting... and never resolves?

更新:

## Custom tasks ------------------------------------------------------------

    grunt.task.renameTask "watch", "watch_default"

    grunt.registerTask "default", "Usage", usage

    grunt.registerTask "scripts", "Compiles the JavaScript files.", [
        "clean:scripts"
        "coffee:all"
        "coffee:env"
        "browserify:all"
        "clean:temp"
    ].concat unless Debug then ["uglify:all"] else []

    grunt.registerTask "stylesheets", "Compiles the stylesheets.", [
        "clean:stylesheets"
        "stylus:all"
        "autoprefixer:all"
    ].concat unless Debug then ["cssmin"] else []

    grunt.registerTask "test", "Run unit testing.", ->
        grunt.fail.fatal "Unit testing is not implemented yet" # TODO

    grunt.registerTask "build", "Compiles all of the assets and copies the files to the Build directory.", [
        "clean:all"
        "copy:static"
        "jade:all"
        "htmlmin:all"
        "stylesheets"
        "scripts"
    ].concat unless Debug then ["clean:production"] else []

    grunt.registerTask "watch", "Builds and watches the project for changes.", [
        "build"
        "watch_default"
    ]

enter image description here enter image description here

0 个答案:

没有答案