Can't upgrade JHipster from 5.0.1 to 5.1.0 - jhipster

I'm trying to generate new app in empty folder.
$ jhipster
Using JHipster version installed globally
Running default command
Executing jhipster:app
Options:
??? ??? ??? ????????? ???????? ??????? ????????? ????????? ????????
??? ??? ??? ????????? ????????? ???????? ????????? ????????? ?????????
??? ????????? ??? ????????? ??????? ??? ??????? ?????????
??? ??? ????????? ??? ???????? ??????? ??? ??????? ????????
????????? ??? ??? ????????? ??? ???????? ??? ????????? ??? ????
??????? ??? ??? ????????? ??? ??????? ??? ????????? ??? ???
https://www.jhipster.tech
Welcome to JHipster v5.0.1
Application files will be generated in folder: /home/eclipse-workspace/jhtest
_______________________________________________________________________________________________________________
Documentation for creating an application is at https://www.jhipster.tech/creating-an-app/
If you find JHipster useful, consider sponsoring the project at https://opencollective.com/generator-jhipster
_______________________________________________________________________________________________________________
______________________________________________________________________________
JHipster update available: 5.1.0 (current: 5.0.1)
Run yarn global upgrade generator-jhipster to update.
So I canceled this and try:
$ yarn global upgrade generator-jhipster
yarn global v1.7.0
error Outdated lockfile. Please run `yarn install` and try again.
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
Then:
$ yarn install
yarn install v1.7.0
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 0.06s.
It creates node_modules folder and yarn.lock file but
$ yarn global upgrade generator-jhipster
generates error Outdated lockfile as above.
What I missed?

This happens when you mix NPM and Yarn global packages.
To fix, remove from both npm and yarn:
npm uninstall -g generator-jhipster
yarn global remove generator-jhipster
Then install with one or the other:
yarn global add generator-jhipster

Related

Couldn't find package "react-scrips#4.0.1" required by "main#0.1.0" on the "npm" registry

I can't install any packages
yarn install v1.22.5
[1/4] Resolving packages...
error Couldn't find package "react-scrips#4.0.1" required by "main#0.1.0" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
I've tried npm config delete registry and delete node_modules and re-install everything with yarn but they didn't work.
also, my editor shows a list of available versions of other packages but no 'react-scripts'
I think its react-scripts not 'scrips'. You are most probably making typo.

I am getting various warrnings and errors when trying to create react app with npx

I am trying to create react app with npx and get the following error: error fork-ts-checker-webpack-plugin#1.5.0: The engine "yarn" is incompatible with this module. Expected version ">=1.0.0".
Any ideas what could be the source of the issue? any tips would be appreciated. Thanks!
npx create-react-app food
npx: installed 91 in 5.566s
Creating a new React app in /home/oren/m/code/food.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v0.16.1
[1/4] Resolving packages...
[2/4] Fetching packages...
warning fsevents#1.2.9: The platform "linux" is incompatible with this module.
info "fsevents#1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
warning fsevents#2.0.7: The platform "linux" is incompatible with this module.
info "fsevents#2.0.7" is an optional dependency and failed compatibility check. Excluding it from installation.
error fork-ts-checker-webpack-plugin#1.5.0: The engine "yarn" is incompatible with this module. Expected version ">=1.0.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 /home/oren/m/code/food has failed.
Deleting generated file... package.json
Deleting generated file... yarn.lock
Deleting food/ from /home/oren/m/code
Done.
About my environment:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.6 LTS
Release: 16.04
Codename: xenial
$ uname -a
Linux oren 4.4.0-142-generic #168-Ubuntu SMP Wed Jan 16 21:00:45 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
node -v
v12.8.0
npm -v
6.10.2
I have solved by installing latest version of Yarn.
- first uninstall version
- installed latest version npm install -g yarn
- removing yarn cache folder in the AppData folder has solved my issue C:\Users\test\AppData\Local\Yarn
Look at this line in the log error fork-ts-checker-webpack-plugin#1.5.0: The engine "yarn" is incompatible with this module. Expected version ">=1.0.0". It says your yarn version is not compatible. You have yarn v0.16.1 but it has to be above 1.0.0. Please try to update your yarn version.
If anyone else is struggling with this even after uninstalling/reinstalling yarn from npm, for me I actually had an old version of yarn installed outside of npm or another package manager, and I had to uninstall it from the Add or Remove Programs list in Windows.

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