1

Gruntfile的是:

module.exports = (grunt) ->
  grunt.initConfig
    pkg: grunt.file.readJSON 'package.json'

    concurrent:
      tasks: [
        'nodemon'
      ]

    nodemon:
     dev:
        options:
          script: "server.coffee"
          args: []
          ignoredFiles: ["public/**"]
          watchedExtensions: ["coffee"]
          nodeArgs: ["--debug"]
          delayTime: 1
          env:
            PORT: 9001

          cwd: __dirname

  require('load-grunt-tasks')(grunt)

  grunt.registerTask 'start', 'concurrent'

server.coffee的也超级简单:

'use strict'

express = require 'express'
winston = require 'winston'

config = require('environmental-configuration')('./config')

app = express()

app.listen config.port
winston.info "App started on port #{config.port}"

module.exports = app

但是当我这样做时grunt start,我得到:

Running "concurrent:tasks" (concurrent) task

    Running "nodemon:dev" (nodemon) task

Done, without errors.

那么我做错了什么,服务器无法启动?

4

1 回答 1

1

我认为 grunt 不知道调用配置的脚本nodemon,也许看看Running a command in a Grunt Task

于 2014-05-12T15:18:11.867 回答