From d6b134fd9005d911343831270615f80dfead7e3d Mon Sep 17 00:00:00 2001 From: Mickael Jeanroy Date: Sat, 29 Aug 2020 00:10:02 +0200 Subject: [PATCH] fix: fix package spec parsing during cache add process Close #1734 PR-URL: https://github.com/npm/cli/pull/1738 Credit: @mjeanroy Close: #1738 Reviewed-by: @isaacs EDIT(@isaacs): Removed test, pending full test coverage of lib/cache.js --- lib/cache.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/cache.js b/lib/cache.js index a47665c1ef113..3a4681b2af107 100644 --- a/lib/cache.js +++ b/lib/cache.js @@ -80,7 +80,7 @@ const add = async (args, where) => { ' npm cache add \n' log.silly('cache add', 'args', args) const spec = args[0] + - (args[1] === undefined || args[1] === null ? `@${args[1]}` : '') + (args[1] === undefined || args[1] === null ? '' : `@${args[1]}`) log.verbose('cache add', 'spec', spec) if (!spec) {