Reputation: 108
I came across a nodejs repo that included npm in devdependencies. What would be the case that requires such config? Because, installing devdependencies already requires npm.
Upvotes: 1
Views: 1009
Reputation: 222379
This makes sense if a repository uses NPM CLI internally and relies on specific NPM version instead of globally installed NPM, because the behaviour may be changed between major releases:
devDependencies: {
"npm": "^2"
}
While
devDependencies: {
"npm": "*"
}
won't make much sense, except that it will likely use latest stable NPM version, despite which version was installed globally on local system.
This also makes sense if NPM is used programmatically because global packages cannot be normally require
d.
Upvotes: 3
Reputation: 2293
Modules which is required for your local development and does not required for production environment can be listed under devDependencies. Its is good to have devDependencies.
Upvotes: 0