npm audit EINVALIDTAGNAME

When I execute npm audit in a folder with the project’s package.json and package-lock.json I get the following error:

0 info it worked if it ends with ok
1 verbose cli [ '/home/user/Downloads/node-v10.14.0-linux-x64/bin/node',
1 verbose cli   '/home/user/Downloads/node-v10.14.0-linux-x64/bin/npm',
1 verbose cli   'audit' ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session d5b5c65bd8e7ae03
5 verbose stack Error: Invalid tag name "[object Object]": Tags may not have any characters that encodeURIComponent encodes.
5 verbose stack     at invalidTagName (/home/user/Downloads/node-v10.14.0-linux-x64/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:87:15)
5 verbose stack     at fromRegistry (/home/user/Downloads/node-v10.14.0-linux-x64/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:290:13)
5 verbose stack     at Function.resolve (/home/user/Downloads/node-v10.14.0-linux-x64/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:77:12)
5 verbose stack     at Object.keys.forEach.name (/home/user/Downloads/node-v10.14.0-linux-x64/lib/node_modules/npm/node_modules/lock-verify/index.js:26:26)
5 verbose stack     at Array.forEach (<anonymous>)
5 verbose stack     at Promise.all.then.result (/home/user/Downloads/node-v10.14.0-linux-x64/lib/node_modules/npm/node_modules/lock-verify/index.js:25:25)
6 verbose cwd /home/user/projects/test-npm/CRYPTOSTORAGE/repos/crypto-storage/etc/approvalClient
7 verbose Linux 3.10.0-862.14.4.el7.x86_64
8 verbose argv "/home/user/Downloads/node-v10.14.0-linux-x64/bin/node" "/home/user/Downloads/node-v10.14.0-linux-x64/bin/npm" "audit"
9 verbose node v10.14.0
10 verbose npm  v6.5.0
11 error code EINVALIDTAGNAME
12 error Invalid tag name "[object Object]": Tags may not have any characters that encodeURIComponent encodes.
13 verbose exit [ 1, true ]

If this would happen to only one project – but actually it does indeed happen to all projects that I’ve tried (~70). There is an internal registry, but I’ve both removed the local .npmrc and the one in home. Also the error I was getting then was a different one.

Is this a bug or am I doing something wrong?

Source: Angular

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.