npm删除依赖项_npm依赖项和devDependencies

npm删除依赖项

When you install an npm package using npm install <package-name>, you are installing it as a dependency.

使用npm install <package-name>安装npm软件包时,将其作为依赖项进行安装。

The package is automatically listed in the package.json file, under the dependencies list (as of npm 5: before you had to manually specify --save).

该软件包会自动在package.json文件dependencies列表下列出(从npm 5开始:必须手动指定--save )。

When you add the -D flag, or --save-dev, you are installing it as a development dependency, which adds it to the devDependencies list.

当添加-D标志或--save-dev ,您会将其安装为开发依赖项,并将其添加到devDependencies列表中。

Development dependencies are intended as development-only packages, that are unneeded in production. For example testing packages, webpack or Babel.

开发依赖关系旨在作为仅开发包,在生产中不需要。 例如测试包, webpackBabel

When you go in production, if you type npm install and the folder contains a package.json file, they are installed, as npm assumes this is a development deploy.

在生产中,如果键入npm install且该文件夹包含package.json文件,则将安装它们,因为npm假定这是开发部署。

You need to set the --production flag (npm install --production) to avoid installing those development dependencies.

您需要设置--production标志( npm install --production )以避免安装那些开发依赖项。

翻译自: https://flaviocopes.com/npm-dependencies-devdependencies/

npm删除依赖项

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值