This repository has been archived by the owner. It is now read-only.

How can I stop the npm new version notice? #17453

Closed
fengmk2 opened this Issue Jun 27, 2017 · 5 comments

Comments

Projects
None yet
4 participants
@fengmk2
Copy link
Contributor

fengmk2 commented Jun 27, 2017

I search around npm codes and npm documents, still can't find a way to stop the new version upgrade notice.

Is there any way to disable it?

npm-update

@jokeyrhyme

This comment has been minimized.

Copy link

jokeyrhyme commented Jun 27, 2017

It's using this package to display those notices: https://github.com/yeoman/update-notifier
We can see where a check is being made here: https://github.com/yeoman/update-notifier/blob/v2.1.0/index.js#L69

So you should try setting the NO_UPDATE_NOTIFIER environment variable, or passing the --no-update-notifier CLI argument

I'm interested what your use case is, why do you wish to prevent these notices? What if you are using an insecure version of NPM and you forget to update it?

@dex4er

This comment has been minimized.

Copy link

dex4er commented Jun 28, 2017

It is stalled on the machine without Internet (if you install NPM packages offline from *.tgz files):

root      2207  0.0  1.7 1186036 36452 ?       Ssl  17:52   0:00 /usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/update-notifier/check.js {"pkg":{"name":"npm","version":"5.0.3"}}
root      2236  0.0  1.7 1186016 36768 ?       Ssl  17:52   0:00 /usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/update-notifier/check.js {"pkg":{"name":"npm","version":"5.0.3"}}
root      2258  0.0  1.7 1186044 36640 ?       Ssl  17:52   0:00 /usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/update-notifier/check.js {"pkg":{"name":"npm","version":"5.0.3"}}
root      2278  0.0  1.7 1120420 36336 ?       Ssl  17:52   0:00 /usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/update-notifier/check.js {"pkg":{"name":"npm","version":"5.0.3"}}
root      2298  0.0  1.7 1186012 36324 ?       Ssl  17:52   0:00 /usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/update-notifier/check.js {"pkg":{"name":"npm","version":"5.0.3"}}
root      2318  0.0  1.7 1120420 36476 ?       Ssl  17:52   0:00 /usr/bin/nodejs /usr/lib/node_modules/npm/node_modules/update-notifier/check.js {"pkg":{"name":"npm","version":"5.0.3"}}
@jokeyrhyme

This comment has been minimized.

Copy link

jokeyrhyme commented Jun 29, 2017

@dex4er I reported it over here: yeoman/update-notifier#115

@fengmk2

This comment has been minimized.

Copy link
Contributor

fengmk2 commented Jul 3, 2017

@jokeyrhyme It worked! Thanks.

I'm maintainer an installer which dependency on npm. But the users don't know about the npm cli inside.

@travi

This comment has been minimized.

Copy link
Contributor

travi commented Apr 6, 2018

sorry to jump onto a closed thread, but thought it might be a place i could get some thoughts before opening a new issue.

anyone happen to find a way to ignore the message through .npmrc, by chance?

we use nvm with a versioned .nvmrc file to keep the team and build servers on a consistent node version. this also keeps npm consistent across everyone as long as no one upgrades npm manually.

i'd like to commit something that would prevent this notification across the whole team so that we remove the encouragement to get out of sync with each other (which has been resulting in lockfile churn).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.