npm audit passes code EINVALIDTAGNAME from node 8.9.4?

priority:medium
triaged
cli
help-wanted

(CT99) #1

What I Wanted to Do

created a new project and npm found some issues. Suggested running npm audit fix or npm audit

Ran

npm audit

What Happened Instead

$ npm audit
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name “[object Object]”: Tags may not have any characters that encodeURIComponent encodes.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/XXX/.npm/_logs/2018-09-19T18_49_17_137Z-debug.log

Reproduction Steps

$ npm audit
npm ERR! code EINVALIDTAGNAME
npm ERR! Invalid tag name “[object Object]”: Tags may not have any characters that encodeURIComponent encodes.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/XXX/.npm/_logs/2018-09-19T18_49_17_137Z-debug.log

Details

$ more /Users/XXX/.npm/_logs/2018-09-19T18_49_17_137Z-debug.log

0 info it worked if it ends with ok

1 verbose cli [ ‘/Users/XXX/.nvm/versions/node/v8.9.4/bin/node’,

1 verbose cli ‘/Users/XXX/.nvm/versions/node/v8.9.4/bin/npm’,

1 verbose cli ‘audit’ ]

2 info using npm@6.4.1

3 info using node@v8.9.4

4 verbose config Skipping project config: /Users/XXX/.npmrc. (matches userconfig)

5 verbose npm-session 45292bf7fd77978b

6 verbose stack Error: Invalid tag name “[object Object]”: Tags may not have any characters that encodeURIComponent encodes.

6 verbose stack at invalidTagName (/Users/XXX/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:87:15)

6 verbose stack at fromRegistry (/Users/XXX/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:290:13)

6 verbose stack at Function.resolve (/Users/XXX/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/npm-package-arg/npa.js:77:12)

6 verbose stack at Object.keys.forEach.name (/Users/XXX/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/lock-verify/index.js:26:26)

6 verbose stack at Array.forEach (<anonymous>)

6 verbose stack at Promise.all.then.result (/Users/XXX/.nvm/versions/node/v8.9.4/lib/node_modules/npm/node_modules/lock-verify/index.js:25:25)

6 verbose stack at <anonymous>

7 verbose cwd /Users/XXX/temp/HL-COMPOSE/ANGULAR

8 verbose Darwin 17.7.0

9 verbose argv “/Users/XXX/.nvm/versions/node/v8.9.4/bin/node” “/Users/XXX/.nvm/versions/node/v8.9.4/bin/npm” “audit”

10 verbose node v8.9.4

11 verbose npm v6.4.1

12 error code EINVALIDTAGNAME

13 error Invalid tag name “[object Object]”: Tags may not have any characters that encodeURIComponent encodes.

14 verbose exit [ 1, true ]

Platform Info

$ npm --versions

npm --versions
{ npm: '6.4.1',
  ares: '1.10.1-DEV',
  cldr: '31.0.1',
  http_parser: '2.7.0',
  icu: '59.1',
  modules: '57',
  nghttp2: '1.25.0',
  node: '8.9.4',
  openssl: '1.0.2n',
  tz: '2017b',
  unicode: '9.0',
  uv: '1.15.0',
  v8: '6.1.534.50',
  zlib: '1.2.11' }

$ node -p process.platform

darwin

(Noditor) #2

I’m having a similar or related issue. Posted here

Any luck since posting this?


(CT99) #3

No update but I can try again and give you an update shortly.


(Noditor) #4

Thanks. My solution: Removed all the nodules and started re-adding. No longer seeing any “vulnerabilities” and “npm audit” now works.


(Kat Marchán) #5

This seems like a bug for sure, but I would need actual reproduction steps that I can run myself in order to figure out what happened. Smells like a bug in lock-verify, though. /cc @iarna


(CT99) #6

See below for the steps that led to the info in my original post:

$ ng new grabtestroster

CREATE grabtestroster/README.md (1031 bytes)

CREATE grabtestroster/angular.json (3620 bytes)

CREATE grabtestroster/package.json (1319 bytes)

CREATE grabtestroster/tsconfig.json (408 bytes)

CREATE grabtestroster/tslint.json (2805 bytes)

CREATE grabtestroster/.editorconfig (245 bytes)

CREATE grabtestroster/.gitignore (503 bytes)

CREATE grabtestroster/src/favicon.ico (5430 bytes)

CREATE grabtestroster/src/index.html (301 bytes)

CREATE grabtestroster/src/main.ts (370 bytes)

CREATE grabtestroster/src/polyfills.ts (3194 bytes)

CREATE grabtestroster/src/test.ts (642 bytes)

CREATE grabtestroster/src/styles.css (80 bytes)

CREATE grabtestroster/src/browserslist (388 bytes)

CREATE grabtestroster/src/karma.conf.js (964 bytes)

CREATE grabtestroster/src/tsconfig.app.json (166 bytes)

CREATE grabtestroster/src/tsconfig.spec.json (256 bytes)

CREATE grabtestroster/src/tslint.json (314 bytes)

CREATE grabtestroster/src/assets/.gitkeep (0 bytes)

CREATE grabtestroster/src/environments/environment.prod.ts (51 bytes)

CREATE grabtestroster/src/environments/environment.ts (642 bytes)

CREATE grabtestroster/src/app/app.module.ts (314 bytes)

CREATE grabtestroster/src/app/app.component.css (0 bytes)

CREATE grabtestroster/src/app/app.component.html (1141 bytes)

CREATE grabtestroster/src/app/app.component.spec.ts (1019 bytes)

CREATE grabtestroster/src/app/app.component.ts (218 bytes)

CREATE grabtestroster/e2e/protractor.conf.js (752 bytes)

CREATE grabtestroster/e2e/tsconfig.e2e.json (213 bytes)

CREATE grabtestroster/e2e/src/app.e2e-spec.ts (310 bytes)

CREATE grabtestroster/e2e/src/app.po.ts (208 bytes)

fsevents@1.2.4 install /Users/XXXX/temp/HL-COMPOSE/ANGULAR/grabtestroster/node_modules/fsevents

node install

[fsevents] Success: “/Users/XXXX/temp/HL-COMPOSE/ANGULAR/grabtestroster/node_modules/fsevents/lib/binding/Release/node-v57-darwin-x64/fse.node” already installed

Pass --update-binary to reinstall or --build-from-source to recompile

node-sass@4.9.3 install /Users/XXXX/temp/HL-COMPOSE/ANGULAR/grabtestroster/node_modules/node-sass

node scripts/install.js

Cached binary found at /Users/XXXX/.npm/node-sass/4.9.3/darwin-x64-57_binding.node

node-sass@4.9.3 postinstall /Users/XXXX/temp/HL-COMPOSE/ANGULAR/grabtestroster/node_modules/node-sass

node scripts/build.js

Binary found at /Users/XXXX/temp/HL-COMPOSE/ANGULAR/grabtestroster/node_modules/node-sass/vendor/darwin-x64-57/binding.node

Testing binary

Binary is fine

added 1178 packages from 1295 contributors and audited 38290 packages in 21.716s

found 12 vulnerabilities (9 low, 3 high)

run npm audit fix to fix them, or npm audit for details

fatal: name consists only of disallowed characters: . …

McKinley:ANGULAR XXXX$ npm audit

npm ERR! code EINVALIDTAGNAME

npm ERR! Invalid tag name “[object Object]”: Tags may not have any characters that encodeURIComponent encodes.

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/XXXX/.npm/_logs/2018-09-19T18_45_17_462Z-debug.log

McKinley:ANGULAR XXXX$ npm audit

npm ERR! code EINVALIDTAGNAME

npm ERR! Invalid tag name “[object Object]”: Tags may not have any characters that encodeURIComponent encodes.

npm ERR! A complete log of this run can be found in:

npm ERR! /Users/XXXX/.npm/_logs/2018-09-19T18_49_17_137Z-debug.log