You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the opts.callback is used, you do not create lastUpdateCheck so.. Never will be updated and neither can be detected. Because it even does not creates a config file?
this.config=newConfigStore(`update-notifier-${this.packageName}`,{optOut: false,// Init with the current time so the first check is only// after the set interval, so not to bother users right awaylastUpdateCheck: Date.now()});
My use case scenario is that want to create a module that auto updates when needed.
Something like that
exportdefaultfunctionautoUpdater(options){constopts=Object.assign({},options);if(!opts.pkg.name||!opts.pkg.version){thrownewError('unpdateNotifier: pkg.name and pkg.version are required');}opts.callback=(err,info)=>{if(err){throwerr;}if(isInstalledGlobally(opts.pkg.name)&&info.type!=='latest'){execSync(`npm install --global ${opts.pkg.name}`);}};returnunpdateNotifier(opts);}
Currently to check and immediately show notification you have to do something like that:
The problem is that
notifier.update = update;
is undocumented hack so better alternative to do that should be provided.The text was updated successfully, but these errors were encountered: