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

add .npmrc to force npm to use bash. #18936

Merged
merged 2 commits into from
Jun 17, 2022
Merged

Conversation

mshima
Copy link
Member

@mshima mshima commented Jun 16, 2022

Should fix windows ci https://github.com/hipster-labs/jhipster-daily-builds/actions/runs/2507832622.
We use './mvnw' which, is not compatible with cmd, force npm to use bash instead.


Please make sure the below checklist is followed for Pull Requests.

When you are still working on the PR, consider converting it to Draft (below reviewers) and adding skip-ci label, you can still see CI build result at your branch.

@mshima mshima marked this pull request as draft June 16, 2022 16:56
@mshima mshima marked this pull request as ready for review June 16, 2022 22:02
@DanielFran DanielFran merged commit ca1dd9e into jhipster:main Jun 17, 2022
@DanielFran
Copy link
Member

@mshima it will be needed to put back windows tests using prod profile?

@mshima mshima deleted the skip_ci-bash branch June 17, 2022 10:37
@mshima
Copy link
Member Author

mshima commented Jun 17, 2022

@DanielFran prod tests won’t work because they need docker now.
There is no way to install docker on GitHub action’s windows right now.

@DanielFran DanielFran added this to the 7.9.0 milestone Jun 22, 2022
@OmarHawk
Copy link
Contributor

OmarHawk commented Jun 27, 2022

Puh, this took me a few hours to figure out that this here may be the reason the new version actually broke my local build on Windows, which was previously working and was set up with the default. In my scenario, this change here now makes use of wsl bash, which does not work properly for me, as

"bash -c node"

will fail, due to the non-interactive shell not having access to PATH properly by default:

https://unix.stackexchange.com/questions/439151/passing-command-to-bash-from-cmd-exe-wsl-not-working

I "fixed" this now by removing the entry in the generated local .npmrc for now.

Maybe this is some local mis-configuration of my wsl or some co-incidential changes on another place, idk, but in case someone else has the same trouble, this could serve as a starting point for trouble-shooting. For me, stuff is working again. ;-)

FYI: This is how the output is looking like then when the build is starting right after generation of the application:

Start your Webpack development server with:
 npm start

npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.

> dataview@0.0.1-SNAPSHOT clean-www
> rimraf target/classes/static/app/{src,target/}

/mnt/c/Users/myuser/git/mt/dataview3/node_modules/.bin/rimraf: 11: exec: node: not found
ERROR! Command failed with exit code 127: npm run clean-www
Error: Command failed with exit code 127: npm run clean-www
    at makeError (C:\Users\myuser\git\mt\generator-jhipster\node_modules\execa\lib\error.js:59:11)
    at Function.module.exports.sync (C:\Users\myuser\git\mt\generator-jhipster\node_modules\execa\index.js:188:17)
    at JHipsterClientGenerator.spawnCommand.spawnCommandSync (C:\Users\myuser\git\mt\generator-jhipster\node_modules\yeoman-generator\lib\actions\spawn-command.js:35:16)
    at JHipsterClientGenerator.end (C:\Users\myuser\git\mt\generator-jhipster\generators\client\index.js:428:16)
    at Object.<anonymous> (C:\Users\myuser\git\mt\generator-jhipster\node_modules\yeoman-generator\lib\index.js:1097:23)
    at C:\Users\myuser\git\mt\generator-jhipster\node_modules\run-async\index.js:49:25
    at new Promise (<anonymous>)
    at C:\Users\myuser\git\mt\generator-jhipster\node_modules\run-async\index.js:26:19
    at C:\Users\myuser\git\mt\generator-jhipster\node_modules\yeoman-generator\lib\index.js:1098:9
    at new Promise (<anonymous>)
    at JHipsterClientGenerator.executeTask (C:\Users\myuser\git\mt\generator-jhipster\node_modules\yeoman-generator\lib\index.js:1069:12)
    at runLoop.add.once (C:\Users\myuser\git\mt\generator-jhipster\node_modules\yeoman-generator\lib\index.js:1049:14)
    at Immediate.<anonymous> (C:\Users\myuser\git\mt\generator-jhipster\node_modules\grouped-queue\lib\subqueue.js:48:34)
    at processImmediate (node:internal/timers:466:21) {
  shortMessage: 'Command failed with exit code 127: npm run clean-www',
  command: 'npm run clean-www',
  exitCode: 127,
  signal: undefined,
  signalDescription: undefined,
  stdout: undefined,
  stderr: undefined,
  failed: true,
  timedOut: false,
  isCanceled: false,
  killed: false
}

I think, this is something worth mentioning in release notes, don't know, how many people this will affect. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants