Info, rather than Warn, when skipping packages not suitable to target OS #11632
Comments
This should really be a DEBUG level message and not shown at all by default. If an optional dependency isn't meant for my OS, there's no reason I need to know about it. The way the error message is written, it still looks like an error. Plus, npm already doesn't tell me whether or not install was successful, so when I get any output from npm my first reaction is to think it's an error. |
I'm fine with this being a WARN if it's only shown when it would be installed if it was supported:
Yay, no output when nothing happened!
OK, it tried and failed to install something, that's reasonable.
Boo! It did nothing, nothing has changed, there's no reason to complain!
Boo! I suggest adding, for a strawman, |
+1 This is not just a semantic / nitpicker question. Using WARN rather than INFO triggers some downstream tooling errors, see the issue Kukkimonsuta linked above. It is highly annoying to see a yellow warning sign in your tools when everything is OK. Moreover, you end up ignoring it, which may hide other issues. |
Is is possible to tell npm to stop downloading that package?
It happens on every npm install even though it's already cached. |
Yea this is super obnoxious from a devops perspective. WARN's usually mean I need to investigate something and now I'm deviating build script code to let these types of exceptions run by. |
The problem here is the http fetch, not the warning itself. Some people suggest using |
100% right. I'm here because I thought it was an error. |
There is a reason. Otherwise you wouldn't know why npm install is so slow. Even if you already run it. |
Reading the OP again, I really think this issue is about reporting And I really wish someone would do something about this! 😡 I really don't like ignoring all warnings when I run my toolchain, it makes me feel that one day I'll have a real problem. |
But you do have a real problem. If you want to ignore optional dependencies, use |
@Vanuan Sorry but I don't get you.
What if I don't want to ignore all of them? Imagine there is an optional package to use Windows native file watchers, you're telling me that I can't use it? What if I can't control that flag? As others have mentioned before, In the end, the problem is that NPM doesn't follow what is generally considered an ERROR vs a WARNING vs an INFO. And it would be nice to fix it. |
I agree, that The proper workaround would be that npm somehow remembers which optional dependency installs have already failed and skips trying reinstalling them. We'd still have a warning on the very first The solution would be to add support of platform-specific dependencies. |
Hi there ! |
And on that very first The correct workaround is to either stop treating errors in optional dependencies as warnings, or to stop outputting warnings on |
Ok. So there are the following subissues caused by platform (in)compatibility:
Workaround to the first issue is to patch your tooling |
Which is a no-go in case of closed source tooling. E.g. Visual Studio. |
LOL, seriously? Workaround to NPM raising warnings when they are meaningless is to patch all the tools? |
That's a difference between workaround and solution.
change your tooling? :) |
You're right. We should all ditch NPM as a package manager and look for a better alternative... |
@isdzulqor You can ignore the warnings. This issue is about changing the log level from WARN to INFO (or, better yet, DEBUG, so that they won't even show up by default). |
I opened PR: #17530.
|
BTW Yarn just fixed this. In their next release this "warning" will be If you can you should switch from NPM to Yarn, it's better in pretty much every regard: speed, determinist install, offline mode, lock file by default, |
This issue should be reopened and fixed. |
Confirmed this is fixed in yarn 1.0.1:
|
@jods4 Interesting response from the NPM team, considering that community feedback is such a powerful tool to maintain momentum of success. Proactively responding to feedback is usually required to prevent projects from slowly losing relevance, or even eventually failing. I’ll tell you this, I may have projects that fail, but if they do I guarantee it will never happen for some straightforward issue that is being held up in front of my face by the community. Btw, thanks for the yarn recommendation. It seems to work great as a drop in replacement with no hassles. |
Today have updated the npm till the 5.6.0 version and now I'm getting ERR instead of WARN while installing the react-redux package. Some of the dependencies in my project have a dependency on a chokidar. Before I could just ignore that warning but now my builds are failing. --no-optional parameter doesn't help
Question: why npm tries to install something that is considered as optional(is installed in defined conditions) or should be installed on a certain platform? Shouldn't it skip it if does not meet conditions? |
Message when npm of version 5.5.1 is used |
It's probably better to file a separate bug report for this. |
New PR: #19198 |
@gaearon So this was fixed? I still get errors so maybe we should re-open? |
Yes, this absolutely should be re-opened. It's labeled and clear, PR #19198 is not merged yet, this issue is clear, and Linux and Windows people have been seeing that wretched |
In case if anyone is looking for the current state of the issue and haven't had a chance to read all of the related GitHub issues and pull requests, here is a summary: The current "open" ticket for this problem seems to be: #17466 Historically from what I gathered:
I know this history list is long and perhaps a sign that some process improvement may be needed, but this is where we are now. Again: The current "open" ticket for this problem seems to be: #17466 |
Y'all gonna face a problem in the future if y'all ignore the "WARN". |
@YasharF -1 for any reason? |
@vandyw95 you haven't read the discussions and commenting on a closed github issue. |
Per #10768, many users are confused by the message NPM shows when skipping packages not relevant to target OS:
Currently:
Suggest:
I.e, remove the word 'failed' and use 'INFO' instead of 'WARN'
The text was updated successfully, but these errors were encountered: