Problems installing jhipster: "bash: jhipster: command not found" - jhipster

Im trying to install jhipster my very first time and having already problems with the setup :o
I was following the steps on the "Installing JHipster" page for "Local installation with Yarn" (using Angular) which was working fine but now continuing with "Creating an application" gives me an error when trying to execute jhipster:
To generate your application, type:
jhipster
It seems there is just no jhipster binary in my environment even with following the setup steps described in the docs before:
test#test ~/git/test $ yarn global add generator-jhipster
yarn global v1.3.2
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "generator-jhipster#4.13.3" with binaries:
- jhipster
Done in 1.53s.
test#test ~/git/test $ jhipster
bash: jhipster: command not found
Was using this page for installing the requirements and this page for creating the app (having gentoo linux installed). As i was never using yarn or yeoman before im not sure if im missing something here like using a prefix or another program executing "jhipster".

Problem was i didn't have the yarn bin path added to my users PATH. See the comments for more informations.

If you have problems using Yarn globally, be sure to have $HOME/.config/yarn/global/node_modules/.bin in your path.

Related

getting error while installing the yarn in react js project

$ yarn install
yarn install v1.19.1
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies cau
sed by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/5] Validating package.json...
error app#0.3.0: The engine "node" is incompatible with this module. Expected version ">=10.17.0". Got "10.15.2"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
getting the errors while installing the yarn in react js project
error app#0.3.0: The engine "node" is incompatible with this module. Expected version ">=10.17.0". Got "10.15.2"
error Found incompatible module.
Remove package-lock.json and run yarn install --ignore-engines
When working on a team, sometimes another dev installs it. One good way to avoid this happening is using package-locks-checks, which I wrote.
If you run npx package-locks-checks it will check for this kind of inconsistencies and avoid you to have issues on production environment.

Trouble Installing "mobius-client-js"

Keep failing to install mobius-client-js"
C:\WINDOWS\system32>yarn add #mobius-network/mobius-client-js
yarn add v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
error #mobius-network/mobius-client-js#0.5.0: The engine "node" is incompatible with this module. Expected version ">=4 <=9". Got "10.14.1"
error Found incompatible module
Per Yarn's docs, you can use the following methods to add:
You can also specify packages from different locations:
yarn add package-name installs the package from the npm registry
unless you have specified another one in your package.json.
yarn add file:/path/to/local/folder installs a package that is on
your local file system. This is useful to test out other packages of
yours that haven’t been published to the registry.
yarn add file:/path/to/local/tarball.tgz installs a package from a
gzipped tarball which could be used to share a package before
publishing it.
yarn add <git remote url> installs a package from a remote git
repository.
yarn add <git remote url>#<branch/commit/tag> installs a package from
a remote git repository at specific git branch, git commit or git tag.
yarn add https://my-project.org/package.tgz installs a package from a
remote gzipped tarball.
None are working... any help would be amazing.
As per your error message:
The engine "node" is incompatible with this module. Expected version ">=4 <=9". Got "10.14.1"
It looks like you are running NodeJS 10.14.1, but the mobius-client requires a NodeJS version between 4 and 9. You should either check if there's a compatible version of this library or use something like nvm to switch to a previous version of node.

Issue with Jhipster upgrade from 4.5.2 to 4.14.1

We are trying to upgrade our jhipster application to the latest version.
We are trying to upgrade manually as referred in the page [http://www.jhipster.tech/2018/02/27/jhipster-release-4.14.1.html][1]
currently our Jhipster version is 4.5.2
after executing the command
yarn global upgrade generator-jhipster
following is the output:
yarn global upgrade generator-jhipster
yarn global v1.5.1
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Rebuilding all packages...
info Lockfile not saved, no dependencies.
success Saved 0 new dependencies.
Done in 0.11s.
now if I check the Jhipster version it still shows 4.5.2
we want to upgrade to Jhipster 4.14.1
Other Version we use:
node version -> v8.9.4
npm version -> 5.6.0
yarn version -> 1.5.1
What is going wrong in our upgrade steps that we do?
It seems that you actually did not fully follow the release note.
Have you executed the second command ?
jhipster upgrade
EDIT:
If you follow the manual way to update, then have you follow this instruction ?
If you have an existing project, it will still use the JHipster
version with which it was generated. To upgrade your project, you must
first delete its node_modules folder and then run:
jhipster

zsh: command not found: jhipster

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 "generator-jhipster#4.5.0" 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`"
I had the same problem and solved it by running yarn global bin and adding the returned value to my PATH.
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.
This issue seems to be fixed. Reinstall generator-jhipster and it is working again.
yarn global add generator-jhipster
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
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
Confirm your global bin path
yarn global bin
I got: /home/username/.yarn/bin
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
add the following to ~/.bash_profile
export PATH="$PATH:`yarn global bin`"
for zsh users, be sure to add this line to ~/.zshrc
restart your shell or start a new one
bash -l or zsh
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
Try with sudo.
sudo yarn global add generator-jhipster

yo cannot find jhipster after yarn global add generator-jhipster

I'm trying to generate a jHipster project using yarn - https://jhipster.github.io/installation/
I installed Node from its website and yarn with brew.
yarn version 0.19.1
node version v7.5.0
OSX Sierra 10.12.3
When I run yarn global add generator-jhipster, I could see jhispter generator being copied to /Users/{username}/.config/yarn/global/node_modules/
my-mac:~ user$ yarn global add generator-jhipster
yarn global v0.19.1
warning No license field
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 📃 Building fresh packages...
warning undefined has no binaries
warning No license field
✨ Done in 30.68s.
As the next step, when I run yo jhipster, it cannot find jhipster. However, when I run yarn add generator-jhipster, yo can find jhipster from current folder. Not sure whats wrong with adding in global location.
my-mac:~ user$ echo $PATH
/usr/local/sbin:~/.composer/vendor/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/Cellar/node/7.5.0/bin:/Users/{user}/.config/yarn/global/node_modules/.bin
Will appreciate any help in identify whats going on or if there is any issue with latest yarn version.
my-mac:~ user$ yo jhipster
Error jhipster
You don’t seem to have a generator with the name “jhipster” installed.
I had the same problem and the cause was my laziness. I did not took time to read the notes of Local installation with Yarn documentation:
Note: if you have problem to use these tools globally, be sure you have $HOME/.config/yarn/global/node_modules/.bin in your path.
On Mac or Linux: export PATH="$PATH:$(yarn global bin):$HOME/.config/yarn/global/node_modules/.bin"
To fix this issue I needed to install yeoman globally with yarn.
yarn global add yo
I am using Ubuntu and I faced this issue too. Then I use sudo to add yo package
sudo yarn global add yo
Hope this will helpful to you.

Resources