bahmutov / pre-git

Automatically install pre-commit / pre-push hooks in your git repo
168 stars 22 forks source link

postinstall fails #41

Closed nikravi closed 9 years ago

nikravi commented 9 years ago

I have a dependency project (e.g. B) that uses pre-git. Requiring the project B in project A, and doing npm install, fails with this error:

> pre-git@1.2.11 postinstall /Users/nracovit/Dev/project-A/node_modules/project-B/node_modules/pre-git
> node install
>>> ... removes the existing hooks under the root project A, it should not ....
> /Users/nracovit/Dev/project-A/node_modules/angular-scope-watch-promise/node_modules/pre-git/install.js:185
    throw new Error('Cannot find changelog module among ' +
          ^
Error: Cannot find changelog module among ["node_modules/pre-git/node_modules/cz-conventional-changelog","node_modules/cz-conventional-changelog"]

I think it's due to the "postinstall": "node install", line in pre-git. I guess it should be "postinstall": "./node install", or similar. Can you verify?

Thank you!

bahmutov commented 9 years ago

can I ask which version of pre-git it is trying to install?

nikravi commented 9 years ago

project B has 1.2.11, and it's working fine. Oh, maybe I can require pre-git as 'devDependency' now it's 'dependency' and it's installed on the parent objects.

bahmutov commented 9 years ago

probably should be devDependency in general, I will check of course, but I never had problems requiring project that required pre-git

nikravi commented 9 years ago

yep, moved to devDependency and solved the issue. Thanks