“npm安装”和“npm—userconfig=./”之间的区别是什么?npmrccorp我”

时间:2021-02-01 07:16:15

I want to know what the difference is between these two commands in nodejs npm install and, npm --userconfig=./.npmrccorp i

我想知道在nodejs npm安装和npm——userconfig=./中这两个命令之间的区别。npmrccorp我

As far as I know both will install the required node modules specified in the package.json.

据我所知,两者都将安装package.json中指定的所需节点模块。

2 个解决方案

#1


3  

Both are different

两个是不同的

  • npm install: This is the install modules mentioned in package.json while considering the configuration file from your home directory i.e. ~/.npmrc . This is same as npm i
  • npm安装:这是包中提到的安装模块。在考虑来自主目录的配置文件时,例如~/。npmrc。这和npm我是一样的。
  • npm --usercofig=./.npmrccorp i: This will install the modules as mentioned in package.jsonwhile considering the configuration file supplied by the --userconfig argument. The last i and install are interchangeable. This can be rewritten as npm --usercofig=./.npmrccorp install also
  • npm——usercofig =。/。npmrccorp i:这将安装包中提到的模块。在考虑由—userconfig参数提供的配置文件时,jsonwhile执行。最后一个i和install是可以互换的。这可以重写为npm——usercofig=./。npmrccorp安装也

More details can be read at http://browsenpm.org/help/misc/npm-config

更多细节可以在http://browsenpm.org/help/misc/npm-config上阅读

#2


1  

One uses npm with the regular default settings, the other uses npm with the settings defined in the file ./.npmrccorp.

一个使用npm进行常规的默认设置,另一个使用npm进行文件中定义的设置。

A example common use case for this is if you work at a company that has its own npm registry.

一个常见的用例是,如果你在一家拥有自己的npm注册表的公司工作。

The settings in ./.npmrccorp will fetch npm modules from your company's private npm registry, but the default settings would fetch modules from the default one at registry.npmjs.org.

设置在。/。npmrccorp将从您公司的私有npm注册表中获取npm模块,但是默认设置将从registry.npmjs.org的默认设置中获取模块。

#1


3  

Both are different

两个是不同的

  • npm install: This is the install modules mentioned in package.json while considering the configuration file from your home directory i.e. ~/.npmrc . This is same as npm i
  • npm安装:这是包中提到的安装模块。在考虑来自主目录的配置文件时,例如~/。npmrc。这和npm我是一样的。
  • npm --usercofig=./.npmrccorp i: This will install the modules as mentioned in package.jsonwhile considering the configuration file supplied by the --userconfig argument. The last i and install are interchangeable. This can be rewritten as npm --usercofig=./.npmrccorp install also
  • npm——usercofig =。/。npmrccorp i:这将安装包中提到的模块。在考虑由—userconfig参数提供的配置文件时,jsonwhile执行。最后一个i和install是可以互换的。这可以重写为npm——usercofig=./。npmrccorp安装也

More details can be read at http://browsenpm.org/help/misc/npm-config

更多细节可以在http://browsenpm.org/help/misc/npm-config上阅读

#2


1  

One uses npm with the regular default settings, the other uses npm with the settings defined in the file ./.npmrccorp.

一个使用npm进行常规的默认设置,另一个使用npm进行文件中定义的设置。

A example common use case for this is if you work at a company that has its own npm registry.

一个常见的用例是,如果你在一家拥有自己的npm注册表的公司工作。

The settings in ./.npmrccorp will fetch npm modules from your company's private npm registry, but the default settings would fetch modules from the default one at registry.npmjs.org.

设置在。/。npmrccorp将从您公司的私有npm注册表中获取npm模块,但是默认设置将从registry.npmjs.org的默认设置中获取模块。