40
23

More than 5 years have passed since last update.

SourcetreeやTowerでhuskyを使おうとするとnodeコマンドが見つからなくて動かないのを解決する

Last updated at Posted at 2018-05-15

タイトル通り。GUI使いたいし、husky使いたいのに以下のようなエラーがでてくるので直接Gitコマンドを叩かざるを得なくなり困った。

.git/hooks/pre-commit: line 49: node: command not found

SourcetreeやTowerは.bash_profile.bashrcを読み込まないので(?)、nodeがどこにあるかわからない模様。対応としては、いちどSourcetreeやTowerアプリを終了して、普段使うターミナルからアプリを起動しなおせばOK。

SourceTree

  • SourceTreeのコマンドラインツールをインストールした状態で「stree」コマンドを実行。
  • もしくは「open ~/Applications/SourceTree.app」のコマンドを実行

Tower

参考

環境

  • macOS High Sierra 10.13
  • Sourcetree 2.7
  • Tower 2.6
  • ndenv 0.4.0 でNodeを管理
40
23
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
40
23