Antfish
Antfish

Reputation: 1493

Why doesn't "npm audit" CLI command run from Powershell in Windows 10?

When I run the npm audit task in Powershell I get a prompt asking "Did you mean this? Edit"

I am running in the root directory of my project (with the package.json file) and other npm commands work as expected.

It appears that the command is not recognised. From what I can see in the documentation: https://docs.npmjs.com/cli/audit this should work out of the box without any other packages.

Upvotes: 2

Views: 951

Answers (1)

RyanZim
RyanZim

Reputation: 6994

The npm audit command was added in npm v6. [1]

Node.js v10.3.0 was the first Node version to bundle npm v6 with it. Upgrading to Node v10.3.0 or later will get you npm v6 and npm audit support.

You can also upgrade your npm version independently of your Node.js version by running npm install -g npm. [2]

Upvotes: 3

Related Questions