yeoman / update-notifier

Update notifications for your CLI app
BSD 2-Clause "Simplified" License
1.76k stars 132 forks source link

update-notifier output contains template variable names instead of actual versions and update command #199

Closed nina-py closed 3 years ago

nina-py commented 3 years ago

Rather than display the current version, latest version and command to update, this package shows me the template of the notification message.

Reporting here as it appears to be an upstream bug for the Gatsby project: https://github.com/gatsbyjs/gatsby/issues/28201.

I have run the https://github.com/yeoman/update-notifier/blob/master/example.js locally with one modification - I added dumping the object as well and this is what I get:

$ node example.js

UpdateNotifier {
  options: {
    pkg: { name: 'public-ip', version: '0.9.2' },
    updateCheckInterval: 0,
    distTag: 'latest'
  },
  packageName: 'public-ip',
  packageVersion: '0.9.2',
  updateCheckInterval: 0,
  disabled: false,
  shouldNotifyInNpmScript: undefined,
  config: Configstore {
    path: '/home/ninap/.config/configstore/update-notifier-public-ip.json'
  },
  update: {
    latest: '4.0.2',
    current: '0.9.2',
    type: 'major',
    name: 'public-ip'
  }
}

   ╭──────────────────────────────────────────────────────────╮
   │                                                          │
   │   Update available {currentVersion} → {latestVersion}    │
   │              Run {updateCommand} to update               │
   │                                                          │
   ╰──────────────────────────────────────────────────────────╯

Output of echo $PATH $NODE_PATH && node -e 'console.log(process.platform, process.versions)':

/home/ninap/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/ninap/.local/bin
linux {
  node: '14.15.0',
  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'
}
sindresorhus commented 3 years ago

This was fixed a while ago: https://github.com/yeoman/update-notifier/releases/tag/v5.0.1

nina-py commented 3 years ago

Thank you @sindresorhus!