What is the npm command to install devDependencies worldwide?

I would rather type a short command, such as npm install -g , to install global project dependencies such as node-sass and jshint, than manually print npm install -g every single package . Is there an npm idiomatic way to do this?

+8
install package global
source share
1 answer

You are using npm install -g <pkg> here incorrectly. -g indicates that it is project independent rather than global (PC wide).

These plugins are not devDependencies, but CLI runners. When initializing, you want npm install --save-dev every single package . When you need to install these dependencies again, you simply run npm install and include something like ./node_modules/.bin/jshint in your package.json scripts so that it does not depend on the CLI.

+1
source share

All Articles