el-lugy
el-lugy

Reputation: 408

Should I have npm as dependency in package.json?

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

Answers (2)

kit
kit

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

Harshal Yeole
Harshal Yeole

Reputation: 4983

No, you don't need to have NPM as the dependency in package.json file.

Upvotes: -1

Related Questions