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

Maven displays npm logs as errors #411

Closed
jeerbl opened this issue May 4, 2016 · 9 comments
Closed

Maven displays npm logs as errors #411

jeerbl opened this issue May 4, 2016 · 9 comments

Comments

@jeerbl
Copy link

jeerbl commented May 4, 2016

I set the loglevel to http for my npm install. When npm install gets executed by the Maven Frontend Plugin, it is displayed as [ERROR] instead of [INFO].

Partial log below:

15:36:22 [INFO] Running 'npm --userconfig D:\sf\p2\sf-jobs\7942d5cf032b28f7\mockups\.npmrc install --no-optional' in D:\sf\p2\sf-jobs\7942d5cf032b28f7\mockups
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//bless
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//body-parser
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//bower
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//bower-art-resolver
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//commander
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//connect-gzip
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//del
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//express
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//fastclick
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//file
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//findup-sync
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//fontfaceobserver
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//glob
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-add-src
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-angular-htmlify
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-angular-templatecache
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-bless
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-changed
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-concat
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-debug
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-directory-map
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-help
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-htmlmin
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-if
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-livereload
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-ng-annotate
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-rename
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-replace
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-sass
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-sourcemaps
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-uglify
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-util
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//gulp-webserver
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//jasmine-core
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//jsdoc
15:36:28 [ERROR] npm http request GET https://registry.npmjs.org//karma

Do you think it is related to Maven or the Frontend plugin? Or is it NPM returning wrong code?

@eirslett
Copy link
Owner

eirslett commented May 4, 2016

It's probably npm writing to stderr for some reason.

@jonesbusy
Copy link

Same issue for me.

But sadly npm seems to log http level to stderr...

$ npm install > out 2> err & tail -n 2000 -f err

@newbearclaw
Copy link

I have the same problem my packages are getting downloaded fine but these errors are raising questions.
More confusing part of it is that I have specified a private registry in my project level .npmrc. What these log messages are showing a different npm registry.
I am not sure which registry is getting used to download the modules.

@dlabey
Copy link

dlabey commented Feb 1, 2017

Anyone able to fix this?

@mriehema
Copy link
Contributor

mriehema commented Feb 2, 2017

You could open a pull request for this with a similiar fix like in #380. But you should probably wait for #561 to avoid merge conflicts.

@dlabey
Copy link

dlabey commented Feb 2, 2017

Interesting... what if instead of implicitly assuming its an error only assume its an error if npm ERROR occurs? I think the explicit assuming would be more ideal to most?

@eirslett
Copy link
Owner

eirslett commented Feb 2, 2017

This is something that should be fixed in npm, it doesn't make sense that it logs stuff to stderr if it's not errors.

@apaatsio
Copy link

stderr can be used to log all kinds of diagnostic output. I'm not saying it's a good (or a bad) thing but that's the status quo. Exit status is the standard way to detect if a process has failed or not.

@eirslett
Copy link
Owner

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.

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

No branches or pull requests

7 participants