Cz-cli: git: 'cz' is not a git command. See 'git --help'.

Created on 21 Jul 2016  Â·  4Comments  Â·  Source: commitizen/cz-cli

I don't know how to deal with this.

I assumed it was simply a Path or symlink issue but got no where at all trying to understand how they work between bash, npm, git and commitizen.

install

 you@trykik:~/projects/tryCommitizen$  sudo npm install commitizen -g
 npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
 npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
 npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
 npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
 npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
 /home/you/.npm/bin/git-cz -> /home/you/.npm/lib/node_modules/commitizen/bin/git-cz
 /home/you/.npm/bin/commitizen -> /home/you/.npm/lib/node_modules/commitizen/bin/commitizen
 /home/you/.npm/lib
 └─┬ [email protected] 
   ├─┬ [email protected] 
   │ ├── [email protected] 
   │ ├── [email protected] 
   │ ├─┬ [email protected] 

       :

   ├── [email protected] 
   ├── [email protected] 
   ├── [email protected] 
   └── [email protected] 

run

 you@trykik:~/projects/tryCommitizen$ git cz
 git: 'cz' is not a git command. See 'git --help'.

 Did you mean one of these?
      am
      fsck
      gc
      mv
      rm

.profile

 you@trykik:~/projects/tryCommitizen$ cat ~/.profile

       :

 # set PATH so it includes user's private bin if it exists
 if [ -d "$HOME/bin" ] ; then
     PATH="$HOME/bin:$PATH"
 fi

 export PATH=~/npm/bin:$PATH

.npmrc

 you@trykik:~/projects/tryCommitizen$ cat ~/.npmrc 
 ; cli configs
 prefix = "~/.npm"

system

 you@trykik:~/projects/tryCommitizen$ lsb_release -a
 No LSB modules are available.
 Distributor ID:    Ubuntu
 Description:   Ubuntu 16.04.1 LTS
 Release:   16.04
 Codename:  xenial



 you@trykik:~/projects/tryCommitizen$ node --version
 v4.4.7


 you@trykik:~/projects/tryCommitizen$ npm --version
 3.10.3



 you@trykik:~/projects/tryCommitizen$ 

Please let me know if you need more information.

Most helpful comment

I had to install commitizen as global npm package fot git cz to work.

All 4 comments

I'm not an expert on where npm puts things, but something I noticed is you have export PATH=~/npm/bin:$PATH but the symlink was created at /home/you/.npm/bin/git-cz. There's a "." before npm. Try changing that in your .profile file.

If that doesn't work, you might have more luck on superuser.com.

That's very astute. Thank you.

I have since killed the VM I was using to try that. I believe ´NodeJS´ and ´npm´ were installed on it using ´apt´.

I am now on a different VM, where I know I installed ´NodeJS´ and ´npm´ with ´nvm´.

Now I have no problem at all.

I believe that @pmcelhaney's solution is probably the correct one, please feel free to reopen if you have problems with it...

I had to install commitizen as global npm package fot git cz to work.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rigobauer picture rigobauer  Â·  4Comments

micky2be picture micky2be  Â·  6Comments

LinusU picture LinusU  Â·  8Comments

athewsey picture athewsey  Â·  4Comments

brandondurham picture brandondurham  Â·  7Comments