observing/pre-commit

Cannot install on Windows?

Closed this issue · 4 comments

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

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.

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

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

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