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.2k stars 867 forks source link

[ERROR] npm info ok ==> wrong Log Level #733

Open georg-koch opened 6 years ago

georg-koch commented 6 years ago

I'm very confused, when I see the following log message in my console. What is it? Error or INFO? Please change the Log-Level

[INFO] --- frontend-maven-plugin:1.4:npm (npm info) @ XYZ ---
[INFO] Running 'npm info npm version --always-auth=false --loglevel=info --progress=false --https-proxy=http://localhost:3128 --proxy=http://localhost:3128' in C:\Users\XYZ\XYZ
[ERROR] npm info it worked if it ends with ok
[ERROR] npm info using npm@3.10.10
[ERROR] npm info using node@v6.11.0
[ERROR] npm info attempt registry request try #1 at 09:19:45
[ERROR] npm http request GET http://MY-NPM-REPO/repository/npm-group/npm
[ERROR] npm http 200 http://MY-NPM-REPO/repository/npm-group/npm
[INFO] 6.1.0
[ERROR] npm info ok
ldebs commented 6 years ago

see #411

derTobsch commented 5 years ago

same here. This does not feel good and I think we need to change to another plugin :/ Is there anything I can do?

eirslett commented 5 years ago

Frontend-maven-plugin does not parse log output from npm/node. It reads stuff from stdout from npm and forwards it to stdout in Maven. Similarly, it reads stuff from stderr from npm and forwards it to stderr in Maven. Whenever npm writes to stderr, it will therefore appear as [ERROR] in the build log.

Maybe it works (on Linux/Unix at least) if you use 2>&1 at the end of the npm command?

derTobsch commented 5 years ago

@eirslett I tried to do that but without any success.

          <execution>
            <id>npm-test</id>
            <goals>
              <goal>npm</goal>
            </goals>
            <phase>test</phase>
            <configuration>
              <arguments>run test 2>&amp;1</arguments>
            </configuration>
          </execution>

Maybe this is just wrong :)

just-paja commented 5 years ago

Seen #411.

Sorry to throw links at you, but please see wiki on stderr.

Standard error is another output stream typically used by programs to output error messages or diagnostics.

npm is correctly dumping diagnostic information to stderr. I realize that defining diagnostic information is debatable, but let's not go there. The point is that not everything in stderr is error.

Because we're never going to be able to change how maven and npm interpret usage of stdout and stderr, we should treat this plugin as mediator between the two and treat npm's stderr as diagnostic output, not errors. Maven actually works in simillar way. Check out that all the [INFO]s and [ERROR]s are sent to stdout.

I dare to say that this:

eirslett: At least as far as this plugin is concerned, all it does is forward stdout to Maven's stdout, and stderr to Maven's stderr. I'd say it's a feature, not a bug.

is the wrong approach.

There is one ridiculous example, output of running jest:

[ERROR] PASS test src/reducers/__tests__/forms.js
rymach commented 5 years ago

[ERROR] lerna success

caleniuc commented 4 years ago

Are there any workarounds on this issue?

eirslett commented 4 years ago

Should be fixed in the latest release, I think?

paoloantinori commented 4 years ago

I can confirm that this is fixed on v1.8.0 !

[INFO] warning " > @syndesis/api@0.1.0" has unmet peer dependency "patternfly-react@^2.29.2".