gradle-node-plugin
gradle-node-plugin copied to clipboard
npmInstall hangs indefinitely with no output when running on docker under WSL2 debian
Please help! I'm at my wits' end trying to make this build work.
I have provided a small sample project that reproduces the issue.
Environment:
WSL2 on Windows 10 x64, with the Debian distro; Docker Desktop configured for WSL2
Docker version 20.10.5, build 55c4c88
Executed in Windows Terminal (Debian): https://www.microsoft.com/en-us/p/windows-terminal/9n0dx20hk701?activetab=pivot:overviewtab
Steps to reproduce:
-
Clone the sample project: https://github.com/rmorrise/test-node-gradle This is an empty Angular project in a gradle submodule.
-
Execute the batch file:
./runme.sh
Expected results:
Part one: npm install succeeds when running inside the docker container (this takes less than 2 minutes)
Part two: gradlew clean succeeds when running in the container
Part three: npmInstall task succeeds when running in the container, and verbose logging is displayed
Actual results:
Part one and two succeed
Part three: npmInstall task hangs indefinitely (over an hour) with no output except the following:
This hangs with no output after starting npmInstall task v v v v v
Downloading https://services.gradle.org/distributions/gradle-6.7.1-bin.zip
.........10%..........20%..........30%..........40%..........50%.........60%..........70%..........80%..........90%..........100%
Welcome to Gradle 6.7.1!
Here are the highlights of this release:
- File system watching is ready for production use
- Declare the version of Java your build requires
- Java 15 support
For more details see https://docs.gradle.org/6.7.1/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :test-ui:clean UP-TO-DATE
> Task :test-ui:nodeSetup SKIPPED
> Task :test-ui:npmSetup SKIPPED
> Task :test-ui:npmInstall
Can you try running with --info?
I tried with the same versions and it seems to work fine here
And what happens if you run in the same environment the npm install command directly (not through the plugin)?
I have a similar problem, except that I am not using Docker, and it used to work and now it has started hanging on npmInstall. Using the --info flag: After a while I get warnings like "Performance may suffer from in-memory cache misses. Increase max heap size of Gradle build process to reduce cache misses." Eventually it crashes with message: "Gradle build daemon has been stopped: JVM garbage collector thrashing and after running out of JVM memory"
Increasing the memory only results in it hanging for a longer time. When I run npm install directly there is no problem.
Environment: Windows 10x64, Gradle v7.0.1, plugin v3.1.0, NodeJS v14.16.0, npm v7.17.0
I also experience this issue on Windows with native npm and native gradle.