Reputation: 408
If you accidentally execute npm i npm
it adds npm as a dependency to the package.json and adds entries to the package-lock.json.
Should I revert this? Or does it actually make sense to have npm as dependency in the package.json?
Upvotes: 7
Views: 3496
Reputation: 565
npm
or other package managers are meant to be installed globally.
If you wish to specify the minimum npm
version for your project, you could add this to package.json
"engines" : {
"npm" : ">=x.x.x"
}
Upvotes: 6
Reputation: 4983
No, you don't need to have NPM as the dependency in package.json
file.
Upvotes: -1