diff --git a/lib/view.js b/lib/view.js index 91b32e2fd38fa..e7e404e2ebb86 100644 --- a/lib/view.js +++ b/lib/view.js @@ -202,7 +202,10 @@ class View extends BaseCommand { const spec = npa(pkg) // get the data about this package - let version = spec.rawSpec || this.npm.config.get('tag') + let version = this.npm.config.get('tag') + // rawSpec is only a version if this is a registry spec + if (spec.type === 'registry' && spec.rawSpec) + version = spec.rawSpec const pckmnt = await packument(spec, opts)