zsh: command not found: jhipster
Asked Answered
M

7

5

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`"
Mello answered 20/5, 2017 at 11:30 Comment(0)
B
6

I had the same problem and solved it by running yarn global bin and adding the returned value to my PATH.

Buttocks answered 1/10, 2017 at 8:33 Comment(0)
S
4

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.

Suspend answered 20/5, 2017 at 11:40 Comment(0)
F
2

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

yarn global add generator-jhipster
Fishbowl answered 21/5, 2017 at 8:44 Comment(0)
N
1

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

Nikola answered 21/5, 2017 at 10:14 Comment(0)
M
1

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

Murdocca answered 21/12, 2018 at 5:22 Comment(0)
S
-1

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
Schnapps answered 8/9, 2019 at 11:37 Comment(0)
A
-2

Try with sudo.

sudo yarn global add generator-jhipster

Altercate answered 29/8, 2018 at 8:49 Comment(2)
Can someone explain me why this is wrong? It was worked for me. and with the experience of npm, we used to use 'sudo' to installing global packages. thats why I use same with yarn.Altercate
it is less save to do it with sudo.Bonar

© 2022 - 2024 — McMap. All rights reserved.