npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Issue "EINVALIDTAGNAME" running npm audit


I'm trying a simple tutorial on node.js using npm to dowload the packages. However, when I try to run "npm audit" on my application folder, I get the following error:

C:\dev\blogapp>npm audit
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! C:\Users\TIO9\AppData\Roaming\npm-cache_logs\2019-05-02T15_35_07_215Z-debug.log

Anyone knows what might be wrong here?



I suspect you have an error or problem in your package.json file. Can you post that?

I have a package.json and package-lock.json. I’m sending package.json.package.json (24,4 KB)

The contents of the uploaded file are from a package-lock.json rather than a package.json?

Actually there was no package.json file. Ive tried copying package-lock.json to package.json (as seen suggested on a forum). Originally Ive only had package-lock.json. And running npm audit on this condition, I get “No package.json found: Cannot audit a project without a package.json”.

It was a kind of desperate measure…

npm init is a convenient way to make a starting package.json. It prompts with questions for various fields and suggests defaults.

(And a shortcut I use a lot when creating simple test packages is npm init -y which uses default answers and asks no questions.)