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

 

--save-dev.

 

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.

Pocket
LinkedIn にシェア

  • この記事を書いた人

藤沢瞭介(Ryosuke Hujisawa)

りょすけと申します。18歳からプログラミングをはじめ、今はフロントエンドでReactを書いたり、AIの勉強を頑張っています。off.tokyoでは、ハイテクやガジェット、それからプログラミングに関する情報まで、エンジニアに役立つ情報を日々発信しています!

-JavaScript-en, node-en

Copyright© off.tokyo , 2021 All Rights Reserved Powered by AFFINGER5.