kazazor / git-pre-commit

A pre-commit hook that ignores all the unstagged changes while performing the pre-commit command you wrote (Using Shell, Gulp, Grunt etc..)
https://www.npmjs.com/package/git-pre-commit
MIT License
18 stars 5 forks source link

Error occuring sometimes on installing the package #7

Closed kazazor closed 8 years ago

kazazor commented 8 years ago
> git-pre-commit@0.1.2 postinstall /Users/orkazaz/Developments/Github/gulp-eslint-example/node_modules/git-pre-commit
> gulp hooks:install

[13:06:38] Using gulpfile ~/Developments/Github/gulp-eslint-example/node_modules/git-pre-commit/Gulpfile.js
[13:06:38] Starting 'hooks:clean'...
[13:06:38] "Deleting file: /Users/orkazaz/Developments/Github/gulp-eslint-example/.git/hooks/pre-commit"
[13:06:38] Finished 'hooks:clean' after 14 ms
[13:06:38] Starting 'hooks:install'...
[13:06:38] 'hooks:install' errored after 31 ms
[13:06:38] Error: Task hooks:pre-commit is not configured as a task on gulp.  If this is a submodule, you may need to use require('run-sequence').use(gulp).
    at /Users/orkazaz/Developments/Github/gulp-eslint-example/node_modules/run-sequence/index.js:20:10
    at Array.forEach (native)
    at verifyTaskSets (/Users/orkazaz/Developments/Github/gulp-eslint-example/node_modules/run-sequence/index.js:13:11)
    at /Users/orkazaz/Developments/Github/gulp-eslint-example/node_modules/run-sequence/index.js:32:4
    at Array.forEach (native)
    at verifyTaskSets (/Users/orkazaz/Developments/Github/gulp-eslint-example/node_modules/run-sequence/index.js:13:11)
    at runSequence (/Users/orkazaz/Developments/Github/gulp-eslint-example/node_modules/run-sequence/index.js:94:2)
    at Gulp.<anonymous> (/Users/orkazaz/Developments/Github/gulp-eslint-example/node_modules/git-pre-commit/gulp/tasks/hooks.js:46:7)
    at module.exports (/Users/orkazaz/Developments/Github/gulp-eslint-example/node_modules/orchestrator/lib/runTask.js:34:7)
    at Gulp.Orchestrator._runTask (/Users/orkazaz/Developments/Github/gulp-eslint-example/node_modules/orchestrator/index.js:273:3)
npm WARN GulpEslint@1.1.0 No repository field.
npm WARN GulpEslint@1.1.0 No license field.
npm ERR! Darwin 15.3.0
npm ERR! argv "/usr/local/Cellar/node4-lts/4.3.1/bin/node" "/usr/local/bin/npm" "i"
npm ERR! node v4.3.1
npm ERR! npm  v3.7.1
npm ERR! code ELIFECYCLE

npm ERR! git-pre-commit@0.1.2 postinstall: `gulp hooks:install`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the git-pre-commit@0.1.2 postinstall script 'gulp hooks:install'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the git-pre-commit package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     gulp hooks:install
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs git-pre-commit
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls git-pre-commit
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/orkazaz/Developments/Github/gulp-eslint-example/npm-debug.log
kazazor commented 8 years ago

What was the issue?

Like described in run-sequence when your gulp tasks is split into several files we need to pas the gulp instance to run-sequence so it wouldn't use a different instance from the root directory.:

// Handeling the case when using a different gulp reference than the intended one of the package:
// https://www.npmjs.com/package/run-sequence#using-within-gulp-submodules
var runSequence = require('run-sequence').use(gulp);