简体   繁体   中英

NPM -v not showing version in package.json

I wish to run npm audit and npm audit fix

In my package.json npm is version 6.4.1

"npm": "^6.4.1",

But when I run npm -v in the project directory it shows 5.6.0

When I run npm install npm@latest -g it shows npm@6.4.1

The when I run npm -v in the project directory it shows 5.6.0

What could be the cause of this?

Installing the latest version of node resolves the npm -v version conflict.

This is due to npm being installed during the node install and therefore fixing any conflict with the global installation path.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM