【发布时间】:2019-06-08 16:53:14
【问题描述】:
当我在项目的 package.json 和 package-lock.json 的文件夹中执行 npm audit 时,我收到以下错误:
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 npm@6.5.0
3 info using node@v10.14.0
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 ]
如果这只会发生在一个项目上 - 但实际上它确实发生在我尝试过的所有项目(~70)上。有一个内部注册表,但我都删除了本地的.npmrc 和家里的。我当时得到的错误也是一个不同的错误。
这是一个错误还是我做错了什么?
【问题讨论】:
-
包的
"tags"属性是什么? -
"dependencies": { "lodash._maxpoolsize": { "integrity": "sha1-nUgvRjuOZq++WcLBTtsRcGAXIzQ=", "resolved": "repo.host.com/npmjs-npm-re/lodash._maxpoolsize/-/…", "version": "2.4 .1" }, "http-signature": { "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", "resolved": "repo.host.com/npmjs-npm-re/http-signature/-/…", "requires": { "assert-plus": "1.0.0", “jsprim”:“1.4.1”,“sshpk”:“1.13.1”},“版本”:“1.2.0”...