When someone clones this repo and uses yarn link (yarn >= v1.6.0) to:
Template paths from yeoman might not be read as intended.
If using yarn link makes the template path from yeoman not read correctly, anyone cloning this repo and doing a yarn link could experience this issue.
If template paths are not correctly read, we may have some issues with other paths (destinationPath for instance, from the yeoman API which deals with reading yeoman config files).
Use yarn v.1.[6,7].0, clone this repo, do a yarn link and experience this issue. Possible cause: if more than one JHipster generator has been installed on the machine (possibly with yarn too).
Could be the root cause of the issue discussed in #7877, #7775, #7713, and I've lost count.
To be defined, needs testing starting from v4 to v5.
Not applicable.
entityName.json files generated in the .jhipster directoryNot applicable.
I'm using ArchLinux (and it seems to happen in MacOS and other Linux distros too)
I am also seeing below error while generating new angular monolithic project (fresh project):
Yarn version:
1.7.0
Node version:
8.11.3
Platform:
linux x64
Trace:
TypeError: Reduce of empty array with no initial value
at Array.reduce (<anonymous>)
at PackageLinker.<anonymous> (/usr/share/yarn/lib/cli.js:50461:43)
at Generator.next (<anonymous>)
at step (/usr/share/yarn/lib/cli.js:98:30)
at /usr/share/yarn/lib/cli.js:109:13
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
It could be unrelated, however, good to assert.
@chrisdns Also had an error that may or may not be related:
Trace
yarn install v1.7.0 info No lockfile found. [1/5] Validating package.json... [2/5] Resolving packages... warning enzyme > rst-selector-parser > nearley > [email protected]: Package no longer supported. Contact [email protected] for more info. warning image-webpack-loader > imagemin-gifsicle > gifsicle > bin-wrapper > download > gulp-decompress > [email protected]: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5 warning jest > jest-cli > istanbul-api > [email protected]: 1.2.0 should have been a major version bump [3/5] Fetching packages... info [email protected]: The platform "linux" is incompatible with this module. info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation. [4/5] Linking dependencies... warning " > [email protected]" has unmet peer dependency "[email protected] - 3". warning " > [email protected]" has unmet peer dependency "popper.js@^1.14.3". warning " > [email protected]" has incorrect peer dependency "reactstrap@^5.0.0". warning " > [email protected]" has incorrect peer dependency "redux@^3.5.2". warning " > [email protected]" has unmet peer dependency "babel-core@^6.26.3 || ^7.0.0-0". error An unexpected error occurred: "Reduce of empty array with no initial value". info If you think this is a bug, please open a bug report with the information provided in "/home/ippon/Documents/tests/non/yarn-error.log". info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. yarn run v1.7.0 $ yarn run cleanup && yarn run webpack:build:main $ rimraf target/www /bin/sh: 1: rimraf: not found error Command failed with exit code 127. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. If you find JHipster useful consider supporting our collective https://opencollective.com/generator-jhipster
Afterwards, his environment was messed up has Julien described in the previous thread.
@agaspardcilia , @chrisdns If you check yarn-error.log, then, you should see same stacktrace as I pasted in above comment.
for the record i'm having the issues we discussed even with Yarn 1.6.0 and hence i'm using NPM for all linking purpose now
The issue posted by @vishal423 and @chrisdns is a bug from Yarn version 1.7.0 onwards. I forgot the yarn issue number for that, thats why many of us downgraded to yarn 1.6.0 and I still have weird issues while using link.
Yes I'm also getting this with Yarn 1.6.0.
Seriously, this is totally broken, we are losing days because of that - I know I'm getting angry, but I keep going to their website that prints in big "FAST, RELIABLE, AND SECURE DEPENDENCY MANAGEMENT" on the main page, and I just hate them now.
@deepu105 I'll try some things tonight, mainly combinaisons of JHipster/yarn but also with yeoman.
Yeoman seems to be in the center of this, that's why I think we can solve it.
@jdubois now you know how I felt when we had lunch. Don't lose your hair because of this though :)
The thing that's bugging me is that template paths seem to be off. This is not normal at all.
@deepu105 , I think you mean by below issue. Eagerly waiting for 1.8 release.
https://github.com/yarnpkg/yarn/issues/5876
Oh thanks @vishal423 that's definitely the issue - and also my current workaround
@jdubois they seem to have fixed it in the nightly version... But that doesn't solve the link issue =(
NPM is targetting to 1.8.0.
How so?
They already add yarn 1.8.0 as RC: https://www.npmjs.com/package/yarn
See in tab versions
@MathieuAA , can you try downgrading your nodejs version to v8.10.0 (probably refreshing node_modules of generator-jhipster) and try with yarn v1.7.0. It's weird, but, while doing another change, it started working on my machine :)
For me, it fixed the 1st issue (of template paths), but, not the second one. For that we might need to go with workaround provided by yarn team or wait for v1.8 which might happen soon.
@vishal423 what was the node version you were on? I'm on 8.11.3 and have the template path issue when using Yarn.
I too faced this issue with v8.11.3, but, not with v8.10.0. Before that, I
was using v8.9.1 and never ran into any issue. Yarn was always v1.7.0
~Vishal
On Tue 3 Jul, 2018, 8:43 PM Deepu K Sasidharan, notifications@github.com
wrote:
@vishal423 https://github.com/vishal423 what was the node version you
were on? I'm on 8.11.3 and have the template path issue when using Yarn.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/jhipster/generator-jhipster/issues/7919#issuecomment-402192621,
or mute the thread
https://github.com/notifications/unsubscribe-auth/APQa8fJwIMw2JZmwF4QrR_3CePt_t3siks5uC4otgaJpZM4VA1QG
.
Interesting, there may be a lead, thanks @vishal423 !!
Yes I never thought a minor node version could cause issues. May be it has
some regression or bugs
On Tue, 3 Jul 2018, 8:38 pm Mathieu ABOU-AICHI, notifications@github.com
wrote:
Interesting, there may be a lead, thanks @vishal423
https://github.com/vishal423 !!—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/jhipster/generator-jhipster/issues/7919#issuecomment-402254543,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABDlF4f0JCUvr39z90EB9RrCq-dYxKJoks5uC7o2gaJpZM4VA1QG
.
The easiest way to test that is to use nvm, I'll try with different versions right now
I encounter this, few weeks ago.
For your information, I'm using:
Not to do:
An example of output from Microservice:
yarn install v1.7.0
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
error An unexpected error occurred: "Reduce of empty array with no initial value".
info If you think this is a bug, please open a bug report with the information provided in "/home/pgrimaud/tmp/25-toto/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
If you find JHipster useful consider supporting our collective https://opencollective.com/generator-jhipster
Server application generated successfully.
Run your Spring Boot application:
./mvnw
Congratulations, JHipster execution is complete!
Error output from Angular app:
error An unexpected error occurred: "Reduce of empty array with no initial value".
info If you think this is a bug, please open a bug report with the information provided in "/home/pgrimaud/tmp/26-ng/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
yarn run v1.7.0
$ yarn run cleanup && yarn run webpack:build:main
$ rimraf target/{aot,www}
/bin/sh: 1: rimraf: not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
If you find JHipster useful consider supporting our collective https://opencollective.com/generator-jhipster
Server application generated successfully.
Run your Spring Boot application:
./mvnw
events.js:183
throw er; // Unhandled 'error' event
^
Error: ERROR! webpack:build failed.
at Environment.error (/home/pgrimaud/projects/jhipster/generator-jhipster/node_modules/yeoman-environment/lib/environment.js:157:40)
at module.exports.error (/home/pgrimaud/projects/jhipster/generator-jhipster/generators/generator-base.js:1978:18)
at module.exports.end (/home/pgrimaud/projects/jhipster/generator-jhipster/generators/client/index.js:457:26)
at Object.<anonymous> (/home/pgrimaud/projects/jhipster/generator-jhipster/node_modules/yeoman-generator/lib/index.js:399:25)
at /home/pgrimaud/projects/jhipster/generator-jhipster/node_modules/run-async/index.js:25:25
at new Promise (<anonymous>)
at /home/pgrimaud/projects/jhipster/generator-jhipster/node_modules/run-async/index.js:24:19
at self.env.runLoop.add.completed (/home/pgrimaud/projects/jhipster/generator-jhipster/node_modules/yeoman-generator/lib/index.js:400:11)
at runCallback (timers.js:810:20)
at tryOnImmediate (timers.js:768:5)
My workflow which works on my machine:
I got it working using a Yarn nightly build (version 1.9.0-20180627.0947 ) so that's definitely a Yarn bug
Should we keep this ticket opened ?
Not sure we can do something on our side, unless migrating back to NPM by default.
Lets close it for now, hoping the next yarn release will fix things, if we
encounter issues again we can see
On Wed, 11 Jul 2018, 8:19 am Pascal Grimaud, notifications@github.com
wrote:
Should we keep this ticket opened ?
Not sure we can do something on our side, unless migrating back to NPM by
default.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/jhipster/generator-jhipster/issues/7919#issuecomment-404057796,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABDlF7CJtH4CAd8qFR7Dchkn-xXsM-Hoks5uFZj3gaJpZM4VA1QG
.
Hi, I'm using jhipster from docker, if I create an application in the path /jhipster/app everything goes okey. if I upload the application to a remote repository and download it to another machine that has the docker gives me an error;
/jhipster/app/.mvnw
INFO] > [email protected] webpack:build /home/dev/jhipster/agenda
[INFO] > npm run cleanup && npm run webpack:build:main
[INFO]
[INFO]
[INFO] > [email protected] cleanup /home/dev/jhipster/agenda
[INFO] > rimraf target/{aot,www}
[INFO]
[ERROR] sh: 1: rimraf: not found
[ERROR] npm ERR! file sh
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno ENOENT
[ERROR] npm ERR! syscall spawn
[ERROR] npm ERR! [email protected] cleanup: rimraf target/{aot,www}
[ERROR] npm ERR! spawn ENOENT
[ERROR] npm ERR!
[ERROR] npm ERR! Failed at the [email protected] cleanup script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[WARNING] npm WARN Local package.json exists, but node_modules missing, did you mean to install?
[ERROR]
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR! /home/dev/.npm/_logs/2018-09-20T14_02_44_588Z-debug.log
[ERROR] npm ERR! code ELIFECYCLE
[ERROR] npm ERR! errno 1
[ERROR] npm ERR! [email protected] webpack:build: npm run cleanup && npm run webpack:build:main
[ERROR] npm ERR! Exit status 1
[ERROR] npm ERR!
[ERROR] npm ERR! Failed at the [email protected] webpack:build script.
[ERROR] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[WARNING] npm WARN Local package.json exists, but node_modules missing, did you mean to install?
[ERROR]
[ERROR] npm ERR! A complete log of this run can be found in:
[ERROR] npm ERR! /home/dev/.npm/_logs/2018-09-20T14_02_44_655Z-debug.log
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.167 s
[INFO] Finished at: 2018-09-20T16:02:44+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.eirslett:frontend-maven-plugin:1.6:npm (webpack build dev) on project agenda: Failed to run task: 'npm run webpack:build' failed. org.apache.commons.exec.ExecuteException: Process exited with an error: 1 (Exit value: 1) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Thank you for your help.
Please don't comment on an old issue.
If you think this issue still applies, please create a new ticket with proper details.
If you have a question please use Stack Overflow, and tag the question with jhipster. This helps the project to keep the issue tracker clean. Also, Stack Overflow will give your question a larger audience: