Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Update notifier not working with public npm package #201

Open
vinaysharma14 opened this issue Dec 27, 2020 · 1 comment
Open

Update notifier not working with public npm package #201

vinaysharma14 opened this issue Dec 27, 2020 · 1 comment

Comments

@vinaysharma14
Copy link

System Information

  • OS: macOS Catalina 10.15.7 (19H15)
  • Package Version: ^5.0.1
  • Command Output:
    3.1.1
    /usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Users/vinaysharma/Library/Android/sdk/emulator:/Users/vinaysharma/Library/Android/sdk/tools:/Users/vinaysharma/Library/Android/sdk/tools/bin:/Users/vinaysharma/Library/Android/sdk/platform-tools:/Users/vinaysharma/Development/flutter/bin:/Users/vinaysharma/Library/Android/sdk/emulator:/Users/vinaysharma/Library/Android/sdk/tools:/Users/vinaysharma/Library/Android/sdk/tools/bin:/Users/vinaysharma/Library/Android/sdk/platform-tools:/Users/vinaysharma/Development/flutter/bin
    darwin {
    node: '14.15.3',
    v8: '8.4.371.19-node.17',
    uv: '1.40.0',
    zlib: '1.2.11',
    brotli: '1.0.9',
    ares: '1.16.1',
    modules: '83',
    nghttp2: '1.41.0',
    napi: '7',
    llhttp: '2.1.3',
    openssl: '1.1.1g',
    cldr: '37.0',
    icu: '67.1',
    tz: '2020a',
    unicode: '13.0'
    }

Issue:

I need to show updates for a public npm package, Rapid React. Unfortunately update-notifier doesn’t seem to work. I debugged the notify() function by adding logs and found out the following.

Debugging:

console.log(!process.stdout.isTTY, suppressForNpm, !this.update); // false true true

// the if statement turns out to be true and code execution returns from here
if (!process.stdout.isTTY || suppressForNpm || !this.update || !semver().gt(this.update.latest, this.update.current)) {
    return this;
}

Code:

const updateNotifier = require('update-notifier');
const pkg = require('../package.json');
 
updateNotifier({ pkg }).notify();
@mustafashykh
Copy link

Any updates on this..

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

No branches or pull requests

2 participants