Search code examples
node.jsnpmnpm-audit

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


Solution

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