Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pre-commit script: doctoc.js could not be found #47

Open
npeterkamps opened this issue May 26, 2018 · 3 comments
Open

pre-commit script: doctoc.js could not be found #47

npeterkamps opened this issue May 26, 2018 · 3 comments

Comments

@npeterkamps
Copy link

  • kcd-scripts version: 0.37.0
    because of the potential breaking change in 0.38, I decided not to upgrade
  • node version: 0.8.4
  • npm version: 0.5.3
  • windows version: 10

What you did:

While working on the PR for cypress-testing-library, I thought I'd enable the pre-commit hook. So I added the .opt-in file and added the pre-commit text to it. Then I did the git commit (both SourceTree and command line)

What happened:

Running tasks for README.md [started]
Running tasks for README.md [failed]
→ .\node_modules\doctoc\doctoc.js could not be found. Try `npm install .\node_modules\doctoc\doctoc.js`.

doctoc.js does exist in the node_modules folder.

@kentcdodds
Copy link
Owner

Huh, that's very odd. I'm guessing the problem is the fact that you're on windows maybe? There could be an issue with resolveBin.

Would you be willing to do a little digging to figure out what's going on? It works fine on my machine.

@fiddep
Copy link

fiddep commented Jul 6, 2018

have had the same issue on windows.
After some tinkering I got it to work by replacing \ -> / and running the scripts with npx

Sadly I have not been able to isolate the problem only been able to get it to work.

edit: seems to work fine on arch linux as well. Have not found any apparent drawbacks yet

@danielkcz
Copy link

Just bumped into this issue as well. And yes, I am on Windows too :) But I don't think it's problem of resolveBin because the resolve path .\node_modules\doctoc\doctoc.js is correct. So it seems that issue is in the invocation of the lint-staged command, could be related to CWD or something else. It's fairly confusing :/

layershifter pushed a commit to layershifter/kcd-scripts that referenced this issue Mar 29, 2021
…cdodds#47)



Co-authored-by: Kent C. Dodds <me+github@kentcdodds.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants