Issue "EINVALIDTAGNAME" running npm audit

Hi,

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

Anyone knows what might be wrong here?

Regards,

Renato

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.)

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.