Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Husky install fails when creating reactive microservices #16172

Closed
mraible opened this issue Sep 5, 2021 · 7 comments · Fixed by #16174
Closed

Husky install fails when creating reactive microservices #16172

mraible opened this issue Sep 5, 2021 · 7 comments · Fixed by #16174

Comments

@mraible
Copy link
Contributor

mraible commented Sep 5, 2021

Overview of the issue

Create a new directory and microservice projects in it. husky install fails.

> [email protected] prepare
> husky install


> [email protected] prepare
> husky install

.git can't be found (see https://git.io/Jc3F9)
npm ERR! code 1
npm ERR! path /Users/mraible/Downloads/reactive-stack/blog
npm ERR! command failed
npm ERR! command sh -c husky install

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mraible/.npm/_logs/2021-09-05T13_58_12_704Z-debug.log
.git can't be found (see https://git.io/Jc3F9)
npm ERR! code 1
npm ERR! path /Users/mraible/Downloads/reactive-stack/store
npm ERR! command failed
npm ERR! command sh -c husky install
ERROR! Command failed with exit code 1: npm install
Error: Command failed with exit code 1: npm install
Motivation for or Use Case

It's no fun seeing stack traces when generating JHipster apps.

Reproduce the error
take reactive-ms
git init # initialize git, so apps aren't created with their own .git
jhipster jdl reactive-ms
Related issues

#16055

Suggest a Fix
JHipster Version(s)

main branch

Workaround

Remove "prepare": "husky install" from each package.json.

@pascalgrimaud
Copy link
Member

It looks like each microservices need their own .git folder, so indeed, it's not nice

@mraible
Copy link
Contributor Author

mraible commented Sep 5, 2021

I also saw some Cypress tests that are "pending". It seems that fake data is no longer loaded and might be causing this.

Screen Shot 2021-09-05 at 8 17 31 AM

@pascalgrimaud
Copy link
Member

So these issues need to be fixed, before the next release

@mshima
Copy link
Member

mshima commented Sep 5, 2021

The git repository is in the parent.
I will take a look at this.

I also saw some Cypress tests that are "pending". It seems that fake data is no longer loaded and might be causing this.

Should be fixed by #14103, but never finished the implementation.

@mraible
Copy link
Contributor Author

mraible commented Sep 7, 2021

This still happens. Steps to reproduce:

take reactive-stack
git init
jhipster jdl reactive-ms

Error:

> [email protected] prepare
> husky install


> [email protected] prepare
> husky install

.git can't be found (see https://git.io/Jc3F9)
npm ERR! code 1
npm ERR! path /Users/mraible/Downloads/new-stack/store
npm ERR! command failed
npm ERR! command sh -c husky install
.git can't be found (see https://git.io/Jc3F9)

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mraible/.npm/_logs/2021-09-07T16_08_26_544Z-debug.log
npm ERR! code 1
npm ERR! path /Users/mraible/Downloads/new-stack/blog
npm ERR! command failed
npm ERR! command sh -c husky install
ERROR! Command failed with exit code 1: npm install
Error: Command failed with exit code 1: npm install
    at makeError (/Users/mraible/dev/generator-jhipster/node_modules/yeoman-environment/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/Users/mraible/dev/generator-jhipster/node_modules/yeoman-environment/node_modules/execa/index.js:114:26)
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  shortMessage: 'Command failed with exit code 1: npm install',
  command: 'npm install',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mraible/.npm/_logs/2021-09-07T16_08_26_612Z-debug.log
INFO! Generator app child process exited with code 1
ERROR! Error executing app --reproducible --no-force --with-entities --no-dry-run --no-whitespace --no-bail --no-install-path --no-skip-regenerate --no-skip-yo-resolve --from-jdl --no-skip-cache --no-skip-install --no-force-install --no-ask-answered --no-defaults --no-skip-git
Error: Error executing app --reproducible --no-force --with-entities --no-dry-run --no-whitespace --no-bail --no-install-path --no-skip-regenerate --no-skip-yo-resolve --from-jdl --no-skip-cache --no-skip-install --no-force-install --no-ask-answered --no-defaults --no-skip-git
    at ChildProcess.<anonymous> (/Users/mraible/dev/generator-jhipster/cli/import-jdl.js:194:16)
    at ChildProcess.emit (events.js:376:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
ERROR! Command failed with exit code 1: npm install
Error: Command failed with exit code 1: npm install
    at makeError (/Users/mraible/dev/generator-jhipster/node_modules/yeoman-environment/node_modules/execa/lib/error.js:59:11)
    at handlePromise (/Users/mraible/dev/generator-jhipster/node_modules/yeoman-environment/node_modules/execa/index.js:114:26)
    at processTicksAndRejections (internal/process/task_queues.js:95:5) {
  shortMessage: 'Command failed with exit code 1: npm install',
  command: 'npm install',
  exitCode: 1,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false

@mraible mraible reopened this Sep 7, 2021
@mshima
Copy link
Member

mshima commented Sep 7, 2021

What take reactive-stack is suppose to do?
Could not reproduce using

git init
jhipster jdl reactive-ms

@mraible
Copy link
Contributor Author

mraible commented Sep 7, 2021

take is an alias for mkdir and cd. So it's the same as the following:

mkdir reactive-stack
cd reactive-stack
git init
jhipster jdl reactive-ms

I just tried again with the main branch and it works. I must've been using a released version before.

@mraible mraible closed this as completed Sep 7, 2021
@pascalgrimaud pascalgrimaud added this to the 7.2.0 milestone Sep 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants