npm 命令中 - 和 --(单破折号和双破折号)之间的区别 [英] Difference between - and -- (single and double dash) in npm commands

查看:79
本文介绍了npm 命令中 - 和 --(单破折号和双破折号)之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道这个问题是否已经解决了.

Am wondering if this question is already addressed or not.

我用过几个这样的命令:

I have used few commands like this :

npm install -g

npm install -d

然后我使用了一些:

npm install XYZ --save-dev

npm install --only=dev

--- 的根本区别是什么?

Whats the fundamental difference between - and -- ?

它与主要和次要参数有什么关系吗?

Has it got to do anything with primary and secondary arguments ?

推荐答案

不,只是按照惯例,只有一个破折号 (-d) 的 *nix 命令行开关只有一个字符.带有两个破折号 (--save) 的那些是多个字符长.两者都是可选的.

No, it's simply that by convention, *nix command line switches that are only one dash (-d) are only one character. Those with two dashes (--save) are multiple characters long. Both are optional.

这篇关于npm 命令中 - 和 --(单破折号和双破折号)之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆