I read this thread, but I'm not sure to understand the answers, and it seems it does not answer this particular case. So I prefer to ask this as a specific question:
Are devDependencies
installed with npm install -g my-package
?
I read this thread, but I'm not sure to understand the answers, and it seems it does not answer this particular case. So I prefer to ask this as a specific question:
Are devDependencies
installed with npm install -g my-package
?
No devDependencies are not included when you are installing a package (whether it's your own package or other packages).
Development dependencies are meant only for local development purpose which contains testing framework, documentation libraries and other, which is not required for the consumers who intended to consume /install/ use the packages.
So whenever you install a package using npm -i <package-name>
or npm -i -g <package-name>
it only installs the dependencies not devDependencies. Check out this npm documentation for more info
If my-package
is a npm package that exist in npm registry - it will be installed globally without devDependencies.
The only difference -g
makes in this situation is my-package
would be installed globally in the machine instead of to local node_modules
folder.