observing / pre-commit

Automatically installs a git pre-commit script in your git repository which runs your `npm test` on pre-commit
MIT License
1.88k stars 150 forks source link

Cannot install on Windows? #21

Closed ctumolosus closed 9 years ago

ctumolosus commented 9 years ago

I'm getting the following error while trying to install on Windows:

> pre-commit@1.0.3 install c:\path\to\project\node_modules\pre-commit
> node install.js

fs.js:741
  return binding.symlink(preprocessSymlinkDestination(destination, type),
                 ^
Error: EPERM, operation not permitted 'c:\path\to\project\node_modules\pre-commit\hook'
    at Object.fs.symlinkSync (fs.js:741:18)
    at Object.<anonymous> (c:\path\to\project\node_modules\pre-commit\install.js:49:4)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:906:3
3rd-Eden commented 9 years ago

As the error states, it doesn't have the rights to symlink things, causing it to fail. So it seems that your folder rights are wrong. But it definitely should not cause a failed installation.

3rd-Eden commented 9 years ago

I think it's better to ignore the installation of the hook when symlinking fails.

3rd-Eden commented 9 years ago

Instead of killing your whole npm install process we will now just output an error. Fixed in version 1.0.4

ctumolosus commented 9 years ago

Thanks for your reply. To fix the issue I just had to run the command line as administrator.