5
votes

I couldn't run jhipster generator, got error: zsh: command not found: jhipster

My system is Ubuntu 16.04, I use zsh:

➜ yarn global add generator-jhipster
yarn global v0.24.5
warning No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
      - jhipster
warning No license field
Done in 1.87s.
➜ jhipster
zsh: command not found: jhipster

What did I missed?

Also I have this in my .zshrc:

# npm
export PATH="$PATH:/home/romanovi/.npm-global/bin"
export NODE_PATH="$NODE_PATH:/home/romanovi/.npm-global/lib/node_modules"

# Yarn
export PATH="$PATH:`yarn global bin`"
7

7 Answers

6
votes

I had the same problem and solved it by add "yarn global bin" into my PATH.

4
votes

There seems to be an issue with the last update of jhipster to jhipster cli. Can you try yo jhipster instead while #JHipster try to fix the jhipster cli.

2
votes

This issue seems to be fixed. Reinstall generator-jhipster and it is working again.

yarn global add generator-jhipster
1
votes

We had an issue yesterday with JHipster v4.5.0, it should be solved today with v4.5.1. Can you try it out?

Don't hesitate to give feedback on https://github.com/jhipster/generator-jhipster/issues/5797

1
votes

Update Dec 2018

Just updating the path didn't work for me. I had to also set the yarn prefix.

  • Ubuntu 18.04.1 LTS (bionic)
  • yarn 1.12.3
  • npm v3.5.2
  • node v8.10.0
  • zsh

Steps

  1. Confirm your global bin path

    yarn global bin
    

I got: /home/username/.yarn/bin

  1. set yarn prefix:

    make sure your yarn prefix is the parent directory of your bin directory. You can confirm by running

    yarn config get prefix
    

    when I ran this, my prefix was empty, so I set it:

    yarn config set prefix ~/.yarn
    
  2. add the following to ~/.bash_profile

    export PATH="$PATH:`yarn global bin`"
    

    for zsh users, be sure to add this line to ~/.zshrc

  3. restart your shell or start a new one

    bash -l or zsh

-1
votes

Update September 2019

Just saw this problem on Mac OSX. I gave up on yarn for this.

Instead, I ran npm install -g generator-jhipster instead, and everything installed as expected.

❯ jhipster --version                                   

INFO! Using JHipster version installed globally
6.2.0
-2
votes

Try with sudo.

sudo yarn global add generator-jhipster