yo cannot find jhipster after yarn global add generator-jhipster - node.js

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.

Related

node 19 hangs when installing Realm

I am trying to install realm in a fresh react-native project. but when I run this command yarn add realm or npm I realm it always stop on this step.
[4/4] πŸ”¨ Building fresh packages...
[1/1] β „ realm
and nothing is happening. I have tried many version to install but same issue,
As #engr-aftab-ufaq said, installing nvm and then using the latest LTS version (v18.14.0 as I'm writing), then re-running npm install realm, fixed the problem for me
For node 19, you can try this
npm install --save realm#11.4.0
Please check for compatibility with you node and react native version: https://github.com/realm/realm-js/blob/master/COMPATIBILITY.md

error eslint#5.6.0: The engine "node" is incompatible with this module. when trying to create-react-app

I am trying to create a React App and I am getting the following error in my console.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.10.1
info No lockfile found.
[1/4] πŸ” Resolving packages...
warning react-scripts > eslint > file-entry-cache > flat-cache > circular- json#0.3.3: CircularJSON is in maintenance only, flatted is its successor.
[2/4] 🚚 Fetching packages...
error eslint#5.6.0: The engine "node" is incompatible with this module. Expected version "^6.14.0 || ^8.10.0 || >=9.10.0". Got "9.5.0"
error Found incompatible module
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
Aborting installation.
yarnpkg add --exact react react-dom react-scripts --cwd /Volumes/server2/Desktop/JavaScript/birdcage has failed.
Deleting generated file... package.json
Deleting birdcage / from /Volumes/server2/Desktop/JavaScript
Done.
I have tried brew upgrade node but that didn't seem to work. Any ideas on how this can be fixed would be greatly appreciated.
One of the temporally fix is to run yarn install --ignore-engines
I was facing the same issue, try to add "--use-npm" at the end of create react app commend.
create-react-app appname --use-npm
I had the same problem, simply doing this solved the problem:
npm install node#latest
Try to uninstall yarn and install it via npm.
npm i create-react-app -g
create-react-app yourappname
Make sure that node is installed!
I had the same problem, try it:
yarn config set ignore-engines true
I re-installed node and updated xcode developer tools. Also, re-installed React on that computer which is running Mojave.
Assuming nvm is installed, use it to see which version of node you're using, then use it to change to a later version.
you can change the version with nvm use <version> and then try again
In my Ubuntu 18.04 had a native version from the OS installed that not listed by NVM.
I removed it and then I ran:
Firstly run, nvm install 14.5.0
then run, nvm use 14.5.0
And the installation completed properly.
i had same issue when i was adding router plugin to vue-cli with npx and yarn as well..
In pyhton virtual environment i have updated node version from 8.x.x to 16.x.x and used command nvm use 16.x.x but still problem persists .. i was actually executing command as root .. so nvm is using node version as 8.x.x only ..
after long time i realised executing command with sudo was the issue and then executed as a normal user...
this solution worked for me !!!
As the warning said, I updated node via nvm to the version required. For me having the latest node lts version was enough.
nvm install "lts/*" --reinstall-packages-from="$(nvm current)"
But even after upgrading node, yarn still gave the error.
The problem was npm was still executed from the old .bin path of previous node version. nvm also installs latest version of npm in respective local .bin folder for the node version installed.
I used the following commands then,
nvm install-latest-npm: Attempt to upgrade to the latest working npm on the current node version
nvm install --latest-npm: After installing, attempt to upgrade to the latest working npm on the given node version
After this, it worked properly.
Reference:
How can I change the version of npm using nvm?

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

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

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.

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

Resources