JavaScript-en node-en

What is--save-dev (npm install )

If you look at the various articles, you will see that when you install npm, the




When installing npm, I found that some have it and some don't, so I added


I was curious, so I looked it up.


--What is save-dev?

After some research, it seems that --save-dev is a command to install locally.

To be precise, npm install -g is a command to do a global install, and

Without -g, it is a local install.


So, if you don't put -g when you do npm install, it's the same as -save-dev.


Basically, -save-dev is fine

There's not much benefit to adding -gw when doing npm install, so


Basically, just use --save-dev, i.e. don't add anything when you do npm insyall.


By the way, if you run it with --save-dev, it will be automatically added to the devDependencies in package.json.


And it will not be added to dependencies.


If you use git clone to clone and install the packages you need


If you run npm install --production, devDependencies will not seem to be installed.


On the other hand, if it is in dependencies, it seems to be installed.

LinkedIn にシェア

  • この記事を書いた人

藤沢瞭介(Ryosuke Hujisawa)


-JavaScript-en, node-en

Copyright© , 2021 All Rights Reserved Powered by AFFINGER5.