Giter VIP home page Giter VIP logo

Comments (22)

alallier avatar alallier commented on June 29, 2024 6

Even easier in a root command prompt just call node ./node_modules/pre-commit/install.js which will call the original install script provided by pre-commit and install the symlinked file for you

from pre-commit.

janis-kra avatar janis-kra commented on June 29, 2024 5

Same result for me, although I did not get that error message (in fact I did not get any error, it just did not write the file). The solution in #43 did not work for me.

from pre-commit.

Alex-Sokolov avatar Alex-Sokolov commented on June 29, 2024 5

@alallier Thanks for your time!

Found where is problem.
In my project .git folder not at the same level as node_modules, it located in parent folder.
Now pre-commit fails silently if not found .git folder at the same level.

There is pull-request #55. But not merged yet

from pre-commit.

IAMtheIAM avatar IAMtheIAM commented on June 29, 2024 2

@alallier Your suggestion fixed it for me, thanks. Windows 10 Node 4.4.7

from pre-commit.

xiaoqiang730730 avatar xiaoqiang730730 commented on June 29, 2024 2

thank@alallier
q

I had to try 'pre-commit', but it does not work because of having no ‘pre-commit’ file. so I use node ./node_modules/pre-commit/install.js, it work successfully.

from pre-commit.

alallier avatar alallier commented on June 29, 2024 1

UPDATE: Per my previous comment, upon further testing I disocvered that pre-commit will show the error on the initial install of pre-commit, but if you are to discover that it symlink isn't installed (like it doesn't in Windows without being Administrator) and run the npm i again the error won't show, because the install.js in not ran again, once pre-commit has already been installed.

from pre-commit.

Wangbaogang avatar Wangbaogang commented on June 29, 2024 1

thank @alallier , I try it under the win10 System Node 6.3.0. And it succeeds.

from pre-commit.

barroudjo avatar barroudjo commented on June 29, 2024 1

this should be solved by #84

from pre-commit.

davidhouweling avatar davidhouweling commented on June 29, 2024

Also experiencing the same issue.

from pre-commit.

danielkcz avatar danielkcz commented on June 29, 2024

Same goes for me as well on Windows 10 x64 and Node 6.2.0.

from pre-commit.

robsimm avatar robsimm commented on June 29, 2024

I appreciate that this doesn't resolve the install scenario - but a quick fix can be to manually create the NTFS junction (symlink) yourself. From elevated PowerShell prompt in your repo's .git/hooks/ folder:

cmd /c mklink /H pre-commit ..\..\node_modules\pre-commit\hook

from pre-commit.

alallier avatar alallier commented on June 29, 2024

I confirm what @janis-kra said I received no error at all, it simply just didn't write the file.

from pre-commit.

JakeCooper avatar JakeCooper commented on June 29, 2024

+1

from pre-commit.

davidhouweling avatar davidhouweling commented on June 29, 2024

Its interesting because earlier versions didn't suffer this issue.

from pre-commit.

nikopavlica avatar nikopavlica commented on June 29, 2024

How about just copy the file instead in case symlink fails?

from pre-commit.

neico avatar neico commented on June 29, 2024

I'd prefer the elevate approach as well, if things need it, so be it, no biggie

windows also allows you to run mklink without elevated privileges trough a local policy, but not everyone is going to go that way, and besides,
admin accounts are unaffected by this setting, they still need elevated access

from pre-commit.

clvLabs avatar clvLabs commented on June 29, 2024

Maybe this is the reason:
1a04430

This change might help when moving or renaming the project directory... but it will stop working on Windows.
fs.symlinkSync() seems to have problems making relative 'junction' symlinks on Windows (as per https://nodejs.org/api/fs.html#fs_fs_symlink_target_path_type_callback)
nodejs.org doesn't say that it would also fail for 'file' symlinks, but it smells suspicious... seems like it started failing after that commit was added.

from pre-commit.

 avatar commented on June 29, 2024

I had to adapt @robsimm solution but it worked for me, at least for the moment, until someone fix the issue. You guys can run it on Windows Prompt cmd /c mklink pre-commit ..\..\node_modules\pre-commit\hook with root access.

from pre-commit.

Alex-Sokolov avatar Alex-Sokolov commented on June 29, 2024

@alallier trying on Win 8, Node 7.9.0 executing node ./node_modules/pre-commit/install.js. No messages, no errors, no pre-commit file in git hooks

from pre-commit.

alallier avatar alallier commented on June 29, 2024

@Alex-Sokolov not sure about the errors, but trying running node ./node_modules/pre-commit/install.js in an admin cmd

from pre-commit.

Alex-Sokolov avatar Alex-Sokolov commented on June 29, 2024

@alallier thanks for answer! Sadly, but as admin in cmd also no success

from pre-commit.

alallier avatar alallier commented on June 29, 2024

@Alex-Sokolov not sure what's going on then without more details, that is what worked for me and many others in this issue thread.

from pre-commit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.