grunt-gh-pages
grunt-gh-pages copied to clipboard
Fatal error: spawn ENOENT
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.
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: ['**']
}
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
.
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)
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
.
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.
@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
Any resolution on this? I'm getting the same issue tonight.
- OS: Windows 7 64bit
- [email protected]
- [email protected]
- [email protected]
- npm 1.4.28
- nodejs 0.10.33
Output error:
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!
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