Cannot install jhipster-generator - node.js

I'm trying to follow the install guide on the jhipster website but i can't even run the first instruction, it keeps ETIMEDOUT'ing on me. I tred running it about 30 times now and it keeps failing (sometimes at different urls)
apixandru#DESKTOP-BAA6A1B MINGW64 ~
$ yarn global add generator-jhipster
yarn global v0.20.3
[1/4] Resolving packages...
warning generator-jhipster > yo > fullname > npmconf#2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
error An unexpected error occurred: "https://registry.yarnpkg.com/lodash: connect ETIMEDOUT 104.16.59.173:443".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\apixandru\\AppData\\Local\\Yarn\\config\\global\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
apixandru#DESKTOP-BAA6A1B MINGW64 ~
$ yarn global add generator-jhipster
yarn global v0.20.3
[1/4] Resolving packages...
warning generator-jhipster > yo > fullname > npmconf#2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
error An unexpected error occurred: "https://registry.yarnpkg.com/js-yaml: connect ETIMEDOUT 104.16.59.173:443".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\apixandru\\AppData\\Local\\Yarn\\config\\global\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
apixandru#DESKTOP-BAA6A1B MINGW64 ~
$ yarn global add generator-jhipster
yarn global v0.20.3
[1/4] Resolving packages...
warning generator-jhipster > yo > fullname > npmconf#2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
error An unexpected error occurred: "https://registry.yarnpkg.com/html-wiring: connect ETIMEDOUT 104.16.62.173:443".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\apixandru\\AppData\\Local\\Yarn\\config\\global\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
It looks like it starts making hundreds of get requests and eventually the server refuses to respond to me. I don't get why these responses aren't cached locally so i don't have to perform hundreds of requests every time i retry
https://paste.ubuntu.com/24048741/

I was experiencing the same error, in my case it it was only when trying to to yarn add from a Docker container.
Restarting Docker fixed my problem.

Try to set the registry correctly like:
npm config set registry "https://registry.npmjs.org"

Related

'Command not found' when trying to install expo globally ubuntu [duplicate]

This question already has answers here:
Yarn global command not working
(13 answers)
Closed last year.
When I install expo it installs but it doesn't install. Here are the details about the issue.
I start off by typing:
yarn global add expo-cli#4
When it installs it says:
warning package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#1.2.13: The platform "linux" is incompatible with this module.
info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#2.3.2: The platform "linux" is incompatible with this module.
info "fsevents#2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "expo-cli > xdl > #expo/dev-server > #expo/metro-config > metro-react-native-babel-transformer#0.59.0" has unmet peer dependency "#babel/core#*".
[4/4] Building fresh packages...
When I install expo using yarn I get:
Installed "expo-cli#4.12.0" with binaries:
- expo
- expo-cli
Done in 4.30s.
But when I type 'expo --version' I get:
Command 'expo' not found, did you mean:
command 'exo' from snap exoscale-cli (v1.22.2)
command 'expn' from deb sendmail-base (8.15.2-18)
command 'expr' from deb coreutils (8.30-3ubuntu2)
See 'snap info <snapname>' for additional versions.
Based on what you posted I'm assuming that the folder where yarn installs global node modules isn't in your path.
Try one of these:
Try installing globally with npm (which is probably in your path)
npm i -g expo-cli
Add yarn global folder to path:
echo PATH="$PATH:$(yarn global bin)" >> ~/.bash_profile
See this thread for more info: Yarn global command not working
1: Go to the terminal and first input this
export PATH=$PATH:~/.npm-global/bin
2: After this command and enter this one
source ~/.bash_profile

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.

Node.js Failing to Create App After updating

I'm using Window's bash to create a react app ad I get this error. I tried updating eslint and using npx create-react-app xyz, however, I get the below error message.
$ npx create-react-app demo-counter
npx: installed 1 in 14.364s
Path must be a string. Received undefined
C:\Users\Rob\AppData\Roaming\npm\node_modules\create-react-app\index.js
Creating a new React app in C:\Users\Rob\webprojects\september\demo-counter.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
yarn add v1.9.4
info No lockfile found.
[1/4] Resolving packages...
[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".
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 C:\Users\Rob\webprojects\september\demo-counter has failed.
Looks like you might be on an unsupported version of node. What's the output when you type node -v in your terminal?

npm install not working in laravel 5.6

On a fresh install of laravel 5.6 via composer
How I installed it:
composer create-project laravel/laravel
After installing I ran:
npm install
I get back:
npm notice created a lockfile as package-lock.json. You should commit this file. Up to date in 0.163s.
It does not create a node_modules folder.
If I try using yarn to install the dependencies using:
yarn install
I get back:
yarn install v1.3.2 info No lockfile found. Resolving packages... warning laravel-mix > img-loader > imagemin-mozjpeg > mozjpeg > bin-wrapper > download > gulp-decompress > gulp-util#3.0.8: gulp-util is deprecated - replace it, following the guidlines at https://medium.com/gulpjs/gulp-util-ca3b1f9fac5 | Fetching packages... info fsevents#1.1.3: The platform 'win32' is incompatible with this module. info "fsevents#1.1.3" is an optional dependency and failed compatability check. Excluding it from installation. Linking dependencies.... Building fresh packages... success Saved lockfile. Done in 35.38s
This creates a node_modules folder with only ".yarn-integrity' no modules.
The link to the medium page doesn't work, receive 404 so no luck there.
My node version is: "v8.9.4" and my yarn version is: 'v1.3.2'
Edit: This isn't a git issue. I'm not using git
running:
npm install --dev or npm install --only=dev
This installed the dependencies I needed. For whatever reason in laravel 5.6 all the dependencies are considered devDependencies in the package.json file.
package-lock.json is automatically generated for any operations where npm modifies either the node_modules tree, or package.json. It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates.
Run the following command
git add -A
git commit -m "Commit package-lock.json"
git push -u origin master
Now re-run npm install
Just make sure you are in your project directory e.g
1) cd path/to/my_laravel_project
2) npm install
this because you are not in laravel root folder, when you create a project, at first you are not in folder you need to open your project folder and use
npm i

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