卸载npm和安装npm_使用`npm uninstall`卸载npm软件包

卸载npm和安装npm

To uninstall a package you have previously installed locally (using npm install <package-name> in the node_modules folder, run

要卸载以前在本地 npm install <package-name> (使用node_modules文件夹中的npm install <package-name> ,请运行

npm uninstall <package-name>

from the project root folder (the folder that contains the node_modules folder).

从项目根文件夹(包含node_modules文件夹的文件夹)中。

Using the -S flag, or --save, this operation will also remove the reference in the package.json file.

使用-S标志或--save ,此操作还将删除package.json文件中的引用。

If the package was a development dependency, listed in the devDependencies of the package.json file, you must use the -D / --save-dev flag to remove it from the file:

如果程序包是在package.json文件的devDependencies中列出的开发依赖关系,则必须使用-D / --save-dev标志将其从文件中删除:

npm uninstall -S <package-name>
npm uninstall -D <package-name>

If the package is installed globally, you need to add the -g / --global flag:

如果软件包是全局安装的,则需要添加-g / --global标志:

npm uninstall -g <package-name>

for example:

例如:

npm uninstall -g webpack

and you can run this command from anywhere you want on your system because the folder where you currently are does not matter.

并且您可以在系统上的任何位置运行此命令,因为当前所在的文件夹无关紧要。

翻译自: https://flaviocopes.com/npm-uninstall-packages/

卸载npm和安装npm

  • 1
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值