npm install git-prepush-hook fails
snaray12 opened this issue · 10 comments
Attached are the npm-debug log and the console error.
npm-debug.txt
@sturdynut node -v returns version 0.12.8
@sturdynut - yes I tried. Also I have logged in as root user and tried. Still no luck.
Here's my output on macOS:
nipp $ npm i git-prepush-hook -D
> git-validate@2.2.2 install /Users/juhovepsalainen/Projects/tmp/nipp/node_modules/git-validate
> node bin/install
WARNING: Unable to find a .git directory for this project, installation aborted.
> git-prepush-hook@1.0.1 install .../nipp/node_modules/git-prepush-hook
> node bin/install
nipp@1.0.0 .../nipp
└─┬ git-prepush-hook@1.0.1
└── git-validate@2.2.2
npm WARN nipp@1.0.0 No description
npm WARN nipp@1.0.0 No repository field.
Can you try upgrading Node to LTS (Node 4 at least)? 0.12 is very old.
@snaray12 - As @bebraw mentioned, it would be a good idea to update your node version. I'd recommend using something like NVM (node version manager). If you don't have it, you can just npm install nvm -g
, or you can see more options here: https://github.com/creationix/nvm
After you install I'd recommend using any node version > 5. e.g. nvm install 6
or nvm install 7
and then nvm use 6
or nvm use 7
@bebraw @sturdynut I upgraded to 6.9.1 using nvm and tried. Still I did not had any luck.
@snaray12 - Not entirely sure why this isn't working for you. It looks like your node and npm versions are up to date. The error you are getting "ENOENT" is just a "No such directory error", which could mean folder, file, symlinks, etc. This leads me to think it is either related to permissions or something with running this command on your centos box. Is this a vagrant box?
One last thing to try:
sudo npm install git-prepush-hook
@snaray12 - I also just published a new version that wraps the install with a try/catch. Let me know how it goes.
@sturdynut I finally made it install.
My environment was built around Vagrant and NVM.
I suspect the issue is occurring because I was trying to install on a folder that is mounted into vagrant box.
When I changed the location out of the mounted path it worked.