question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(Docs) Local setup does not work

See original GitHub issue

I followed the steps described in local setup https://commitlint.js.org/#/guides-local-setup?id=add-hook https://github.com/conventional-changelog/commitlint#add-hook

but when I do a commit, it just failes with

.husky/commit-msg: line 3: $(dirname $0)/_/husky.sh: No such file or directory

Expected Behavior

Hook is executed successfully

Current Behavior

The hook cannot be executed

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Possible Solution

I made it work with a shorter command:

npx husky add .husky/commit-msg  "npx --no -- commitlint --edit ${1}"

which could replace the following steps from the docs:

Docs
echo '
#!/bin/sh
. "\$(dirname "\$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
' > .husky/commit-msg

Make hook executable

chmod a+x .husky/commit-msg

I’ll happily provide a PR to change this in the docs. If there is any reason to create this hook by hand it think it need to be changed to

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit

to work correctly. (this is the file npx husky add ... creates for me)

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
thatryancommented, Oct 27, 2022

Thank you, apologies for adding here when this issue was my fault. Freaking node wasn’t running so npx couldn’t be found when I ran the command. All fixed, thank you much.

1reaction
escapedcatcommented, Oct 27, 2022

@TheKangaroo thanks for helping out here! ❤️

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReadTheDocs - build is not working in local setup · Issue #7416
I am trying to setup a Local Read the Docs Server in a Virtual Machine. Followed the steps mentioned in the above URL,...
Read more >
Work on Google Docs, Sheets, & Slides offline - Computer
Install and turn on Google Docs Offline Chrome extension. ... Tip: If your document is not ready to edit offline, an explanation will...
Read more >
Local Setup for Documentation Work
Local Setup for Documentation Work ... In case that doesn't work, the point is to get a command similar to this, replace the...
Read more >
Development Installation
Go to http://devthedocs.org to access your local instance of Read the Docs. Check that everything works¶. Visit http://devthedocs.org. Login as admin ...
Read more >
Troubleshooting Local Testing setup issues in Live
This is caused due to the ClickOnce Trust Prompt Behavior on Windows. This behavior configures whether any Windows ClickOnce Application installation, such as ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found