grunt-gh-pages icon indicating copy to clipboard operation
grunt-gh-pages copied to clipboard

Fatal error: spawn ENOENT

Open dtsn opened this issue 10 years ago • 8 comments

Hi,

I'm having a strange problem where grunt-gh-pages keeps dying with the error "Fatal error: spawn ENOENT" after it's checked out origin/gh-pages.

Cloning [email protected]:datasift/datasift-node.git into .grunt/grunt-gh-pages/gh-pages/src Cleaning Fetching origin Checking out origin/gh-pages Fatal error: spawn ENOENT

It's been driving me crazy, i've made sure all the node modules are installed correctly. This originated from getting lock file errors in git, which i managed to fix by cloning a new repo. However now I can't even get to that error.

Any help would be greatly appreciated.

dtsn avatar Apr 11 '14 10:04 dtsn

I have the same issue. I've tried cleaning npm and bower caches. Updating npm, grunt, bower. Nothing helps.

$ grunt gh-pages
Running "gh-pages:src" (gh-pages) task
Cloning https://github.com/seriema/angular-apimock.git into .grunt/grunt-gh-pages/gh-pages/src
Cleaning
Fetching origin
Checking out origin/gh-pages
Fatal error: spawn ENOENT

My config:

    'gh-pages': {
      options: {
        base: 'dist'
      },
      src: ['**']
    }

seriema avatar Apr 14 '14 19:04 seriema

What version of grunt-gh-pages, grunt-cli, and grunt do you have installed?

Please paste any additional information you get from grunt --verbose --stack gh-pages.

tschaub avatar Apr 14 '14 21:04 tschaub

grunt-gh-pages v0.9.1 grunt-cli v0.1.13 grunt v0.4.4

The output is HUGE, so I'll just copy the end:

Options: add=false, git="git", clone=".grunt/grunt-gh-pages/gh-pages/src", dotfiles=false, branch="gh-pages", remote="origin", base="dist", only=".", push, message="Updates", silent=false
Cloning https://github.com/seriema/angular-apimock.git into .grunt/grunt-gh-pages/gh-pages/src
undefined
Cleaning
undefined
Fetching origin
Checking out origin/gh-pages
2ad113e79cbf5001e3d6cd5f8a2ebdef8179cd53    refs/remotes/origin/gh-pages

Your branch is up-to-date with 'origin/gh-pages'.

Fatal error: spawn ENOENT
Error: spawn ENOENT
    at errnoException (child_process.js:980:11)
    at Process.ChildProcess._handle.onexit (child_process.js:771:34)

seriema avatar Apr 14 '14 22:04 seriema

Thanks for the extra detail. I'll look into this a bit more, but you may be able to immediately work around the problem by using a multi-task configuration. E.g.

  grunt.initConfig({
    'gh-pages': {
      options: {
        base: 'dist'
      },
      firstTarget: {
        src: '[**/*]'
      }
    }
  });

And you can use a different name for firstTarget.

tschaub avatar Apr 16 '14 12:04 tschaub

Thanks, that solved the problem for me. Interesting to note is that my teammate @redhorn did not experience this issue, with the same branch/code/etc.

seriema avatar Apr 17 '14 10:04 seriema

@tschaub Heya, Is there any update to identifying the reason for this problem?

I tried the suggested workaround,

Switched:

    'gh-pages': {
        options: {
            base: '_book'
        },
        src: ['**']
    },

to

    'gh-pages': {
        options: {
            base: '_book'
        },
        publishBook: {
            src: ['**']
        }
    },

However that still gives me the same issue:

Running "gitbook:development" (gitbook) task

Running "gh-pages:publishBook" (gh-pages) task
Fatal error: spawn ENOENT

Viv-Rajkumar avatar Jun 09 '14 12:06 Viv-Rajkumar

Any resolution on this? I'm getting the same issue tonight.

Output error: error2

Gruntfile:

/* global module:false */
module.exports = function(grunt) {
    // Project configuration
    grunt.initConfig({
        'copy': {
            main: {
                files: [{
                    expand: true,
                    cwd: 'src/',
                    src: [
                        '**/*', '!**/node_modules/**'
                    ],
                    dest: 'dist/',
                    flatten: false
                }]
            }
        },

        'gh-pages': {
            options: {
                base: 'dist'
            },
            firstTarget: {
                src: ['**']
            }
        }

    });

    // Dependencies
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-gh-pages');

    // Default task
    grunt.registerTask('default', ['copy']);
    grunt.registerTask('deploy', ['default', 'gh-pages']);

};

Any help is appreciated! Thanks!

gavinr avatar Mar 27 '15 03:03 gavinr

I had the same problem. Same output on terminal.

When i run my grunt gh-pages task it creates a folder .grunt/src

If i delete that folder an run the task again it works fine! If i leave the folder there and run the task again, the output comes:

Cleaning Fetching origin Checking out origin/gh-pages Fatal error: spawn ENOENT

ohmyguigs avatar Jun 30 '16 18:06 ohmyguigs