Lenny86
Lenny86

Reputation: 140

npm audit not working on Windows using bash

I am using Mintty 2.8.4 as my terminal to install npm packages.

I installed an earlier version of an npm package called moment and I got warnings about vulnerabilities. One of the suggestions my terminal gave me was to run npm audit. On running that command my terminal doesn't recognize it. It throws a list of other recognized commands instead.

Can anyone help me with explaining how to run audit on this terminal?

I have attached a detailed image of the error and the terminal I am using.


printscreen of npm audit not working

Upvotes: 3

Views: 6054

Answers (2)

OrangeDog
OrangeDog

Reputation: 38787

It says exactly what you need to do:

Run npm i npm@latest -g to upgrade your npm version, and then npm audit to get more info.

Upvotes: 5

mihai
mihai

Reputation: 38563

npm audit has just been introduced in npm 6, I see you’re running 5.6.0.

https://docs.npmjs.com/getting-started/running-a-security-audit

They have probably made the security reports available in npm 5 as well, but you need npm 6 to run audit.

Upgrading npm will solve the problem.

Upvotes: 9

Related Questions