sindresorhus / grunt-concurrent

Run grunt tasks concurrently

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Concurrent only runs first task on node v0.10.20

guifromrio opened this issue · comments

I thought I was cursed when, all of the sudden, concurrent stopped working altogether while working on CLEAN, my fork of MEAN.

Finally, I returned to the last PC in which it ran OK and, sure enough, it has node v0.10.5 installed.

I have heard it works as far as v0.10.15. Will try it now and report.

Gruntfile is really simple:

grunt.initConfig
  watch:
    public:
      files: ['public/**']
      options:
        livereload: true

  mochaTest:
    main:
      options:
        reporter: 'spec'
      src: ['test/**/*.coffee']

  nodemon:
    main:
      options:
        file: 'server.coffee'
        ignoredFiles: ['node_modules/**', '.idea/**', 'public/**', '.git/**']
        debug: true
        delayTime: 1

  concurrent:
    main:
      tasks: ['watch', 'nodemon']
      options:
        logConcurrentOutput: true

Ah, yes, I tried changing the tasks' order (watch and nodemon) to no avail.

Doesn't seem to work on v0.10.15.

Trying 0.10.10 next.

Ok, it's not working either. Beginning to think it's not about node version. Why doesn't concurrent loves my Ubuntu 12.04.3 VM? :(

My, oh, my...

Turns out, upon inspecting the task's code I stumble upon this snippet here:

var options = this.options({
    limit: require('os').cpus().length
});

Aaaand "That's a bingo!".

My VM only has one virtual CPU. Increasing limit option to 2 solves the problem.

Hope this helps someone, someday. Gonna throw some keywords so folks find this easier:

grunt-concurrent virtualbox virtualization cpu limit one task only

commented

Was just attempting to deploy a generator-angular project which utilises concurrent on a box that only has 1 core and was getting an error: Error: spawn EACCES. Looked at the documentation and it says grunt-concurrent requires a minimum of 2 cores and it's pointless to use it otherwise.

Yeah it's pointless, but I don't want it to fail, I would much rather it take twice as long on a box with only one core :P I'm guessing this is a technical limitation rather than by choice?

@intellix it doesn't fail when there's only one core, you just don't get any benefit of using this plugin. Your error is probably with something else.