eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.26k stars 872 forks source link

yarn run stuck #577

Open maxime-menard opened 7 years ago

maxime-menard commented 7 years ago

Hi,

I'm trying to run a script with yarn run

<execution>
 <id>yarn run build</id>
  <goals>
   <goal>yarn</goal>
  </goals>
  <configuration>
  <arguments>run build</arguments>
  </configuration>
</execution>

But the process is stuck when running the script :

[INFO] yarn run v0.21.3
[INFO] $ ng build 

And then nothing.

When I manually run the command, it works fine.

I use :

It works fine if I use npm

ningod commented 7 years ago

For me works. I tried on master version of the plugin and Maven 3.3.9, Java 1.8.0_112 OS "windows 10"

maxime-menard commented 7 years ago

I tried to use the master version of the plugin, still the same issue

ningod commented 7 years ago

Did you tried with other scripts other than your "build" ?

maxime-menard commented 7 years ago

Yes, I tried the "ng lint" script, same problem

ningod commented 7 years ago

Can you try something simplier like an echo in script section of package.json ?

something similar to this:

  "scripts": {
    "test-echo": "echo test-success",
    "test-return": "return 0",
    "build": "gulp"
  }
<execution>
 <id>yarn run test-echo</id>
  <goals>
   <goal>yarn</goal>
  </goals>
  <configuration>
  <arguments>run test-echo</arguments>
  </configuration>
</execution>
Zacorich commented 7 years ago

Looks like a heapdump. Try to add "-Xms512m -Xmx1024m" to Maven Runner VM Options.

maxime-menard commented 7 years ago

@ningod the test-echo is successful, at least that's something !

@Zacorich I tried to add these options, still the same issue

maapteh commented 7 years ago

Try to run ng using `./node_modules/.bin/ng lint' in your script reference

maxime-menard commented 7 years ago

@maapteh still the same issue, I also tried to upgrade yarn, but it is still stuck.

[INFO] yarn run v0.22.0 [INFO] $ ./node_modules/.bin/ng lint and nothing ..

maapteh commented 7 years ago

If you can post your script build part from package.json (build: ng foo --bar) and is angular-cli also part of your dependency? Because it never can error silencely.

maxime-menard commented 7 years ago

@maapteh

"scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --deploy-url=/js/angular/",
    "prod": "ng build -prod --deploy-url=/js/angular/ --output-hashing none",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
  }
  "devDependencies": {
    "@angular/cli": "^1.0.0-rc.1",
...
}
maapteh commented 7 years ago

then try the npm call from your build? (so build with plugin with node-and-npm) then run 'npm run lint' from your plugin. Also it MUST give errors when nothing is happening for you... Sorry i can't help further for me both node and yarn versions work correctly.

johnisutanto commented 7 years ago

I faced the same issue running yarn run lint. It's just hang forever on windows, but it's working on Mac.

<execution>
<id>linter</id>
<goals>
<goal>yarn</goal>
<configuration>
<arguments>run lint</arguments>
</configuration>
</execution>

package.json:

"scripts": {
    "lint": "standard src/main/js/components/**/*.js src/main/js/**/*.js webpack.config.js",
    "auto-fix-lint": "standard src/main/js/components/**/*.js src/main/js/**/*.js webpack.config.js --fix",
  }

Output:

[INFO] --- frontend-maven-plugin:1.3:yarn (linter) @ gslblui ---
[INFO] Running 'yarn run lint' in S:\Projects\GSUI\applications\shippinglabels
[INFO] yarn run v0.21.3
[INFO] $ standard src/main/js/components/**/*.js src/main/js/**/*.js webpack.config.js 
mriehema commented 7 years ago

Could you please check the following steps:

maxime-menard commented 7 years ago

For me :

johnisutanto commented 7 years ago

@mriehema. Same answer here. "YES" for both. I have a simpler repro you can clone. https://github.com/johnisutanto/simplemavennode

mriehema commented 7 years ago

@johnisutanto Well your test repo works here.

C:\dev\stuff\simplemavennode\src (master) (simple-maven-node@1.0.0)
λ mvn clean install
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building SimpleMavenNode 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ simple-maven-node ---
[INFO]
[INFO] --- frontend-maven-plugin:1.3:install-node-and-yarn (install node and yarn) @ simple-maven-node ---
[INFO] Installing node version v6.9.2
[INFO] Copying node binary from C:\Users\mriehema\.m2\repository\com\github\eirslett\node\6.9.2\node-6.9.2-win-x64.exe to C:\dev\stuff\simplemavennode\src\node\node.exe
[INFO] Installed node locally.
[INFO] Installing Yarn version v0.21.3
[INFO] Unpacking C:\Users\mriehema\.m2\repository\com\github\eirslett\yarn\0.21.3\yarn-0.21.3.\yarn-v0.21.3.tar.gz into C:\dev\stuff\simplemavennode\src\node\yarn
[INFO] Installed Yarn locally.
[INFO]
[INFO] --- frontend-maven-plugin:1.3:yarn (yarn install) @ simple-maven-node ---
[INFO] Running 'yarn ' in C:\dev\stuff\simplemavennode\src
[INFO] yarn install v0.21.3
[INFO] info No lockfile found.
[INFO] [1/4] Resolving packages...
[INFO] [2/4] Fetching packages...
[WARNING] warning fsevents@1.1.1: The platform "win32" is incompatible with this module.
[INFO] info "fsevents@1.1.1" is an optional dependency and failed compatibility check. Excluding it from installation.
[INFO] [3/4] Linking dependencies...
[WARNING] warning "babel-loader@6.4.1" has unmet peer dependency "webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc".
[WARNING] warning "redbox-react@1.3.4" has unmet peer dependency "react-dom@^0.14.0 || ^15.0.0".
[INFO] [4/4] Building fresh packages...
[INFO] success Saved lockfile.
[INFO] Done in 21.06s.
[INFO]
[INFO] --- frontend-maven-plugin:1.3:yarn (linter) @ simple-maven-node ---
[INFO] Running 'yarn run lint' in C:\dev\stuff\simplemavennode\src
[INFO] yarn run v0.21.3
[INFO] $ standard src/main/js/**/*.js
[INFO] Done in 1.94s.
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ simple-maven-node ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\dev\stuff\simplemavennode\src\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ simple-maven-node ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ simple-maven-node ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\dev\stuff\simplemavennode\src\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ simple-maven-node ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ simple-maven-node ---
[INFO] No tests to run.
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ simple-maven-node ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: C:\dev\stuff\simplemavennode\src\target\simple-maven-node-1.0.0.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ simple-maven-node ---
[INFO] Installing C:\dev\stuff\simplemavennode\src\target\simple-maven-node-1.0.0.jar to C:\Users\mriehema\.m2\repository\simple\maven\node\simple-maven-node\1.0.0\simple-maven-node-1.0.0.jar
[INFO] Installing C:\dev\stuff\simplemavennode\src\pom.xml to C:\Users\mriehema\.m2\repository\simple\maven\node\simple-maven-node\1.0.0\simple-maven-node-1.0.0.pom
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.308 s
[INFO] Finished at: 2017-03-22T18:47:54+01:00
[INFO] Final Memory: 12M/237M
[INFO] ------------------------------------------------------------------------

BTW: The path for the script standard src/main/js/**/*.js is wrong, because the package.json is inside src. Changing it to standard main/js/**/*.js will fail correctly via yarn and mvn.

johnisutanto commented 7 years ago

@mriehema Thanks for correcting the path. I tried with the new path but still not working. It's still stuck on yarn lint. I am using Windows 7. Could this be issue with Windows 7? This is the output I have.

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building SimpleMavenNode 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ simple-maven-node ---
[INFO] 
[INFO] --- frontend-maven-plugin:1.3:install-node-and-yarn (install node and yarn) @ simple-maven-node ---
[INFO] Installing node version v6.9.2
[INFO] Copying node binary from S:\Development\mvn\com\github\eirslett\node\6.9.2\node-6.9.2-win-x64.exe to S:\Projects\simplemavennode\src\node\node.exe
[INFO] Installed node locally.
[INFO] Installing Yarn version v0.21.3
[INFO] Unpacking S:\Development\mvn\com\github\eirslett\yarn\0.21.3\yarn-0.21.3.\yarn-v0.21.3.tar.gz into S:\Projects\simplemavennode\src\node\yarn
[INFO] Installed Yarn locally.
[INFO] 
[INFO] --- frontend-maven-plugin:1.3:yarn (yarn install) @ simple-maven-node ---
[INFO] Running 'yarn ' in S:\Projects\simplemavennode\src
[INFO] yarn install v0.21.3
[INFO] [1/4] Resolving packages...
[INFO] [2/4] Fetching packages...
[WARNING] warning fsevents@1.1.1: The platform "win32" is incompatible with this module.
[INFO] info "fsevents@1.1.1" is an optional dependency and failed compatibility check. Excluding it from installation.
[INFO] [3/4] Linking dependencies...
[WARNING] warning "babel-loader@6.4.1" has unmet peer dependency "webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc".
[WARNING] warning "redbox-react@1.3.4" has unmet peer dependency "react-dom@^0.14.0 || ^15.0.0".
[INFO] [4/4] Building fresh packages...
[INFO] Done in 24.96s.
[INFO] 
[INFO] --- frontend-maven-plugin:1.3:yarn (linter) @ simple-maven-node ---
[INFO] Running 'yarn run lint' in S:\Projects\simplemavennode\src
[INFO] yarn run v0.21.3
[INFO] $ standard main/js/**/*.js  
mriehema commented 7 years ago

This could be hard to debug and fix. :-( And yes, I am using Windows 10.

johnisutanto commented 7 years ago

Yeah. I just asked one of my team mate who has Windows 10, and the build was successful. @maxime-menard Are you using Windows 7?

maxime-menard commented 7 years ago

@johnisutanto yes I am

eliihen commented 7 years ago

I have a similar issue (#582), and I also tested using windows 7. My colleague who originally discovered this issue is using Win 7 Enterprise

To reproduce, I simply downloaded a Windows 7 VirtualBox VM from modern.ie, installed git bash and maven, checked out https://github.com/esphen/frontend-maven-plugin from git, and followed the instructions in the README. Then I got the issue right away.

Chocanto commented 7 years ago

Same issue with Win 7 Enterprise. Hangs on yarn run

Chocanto commented 7 years ago

After updating from 1.3 to 1.5, this issue seems to be fixed. You can close it :)