前往小程序,Get更优阅读体验!
立即前往
发布
社区首页 >专栏 >卸载npm和安装npm_使用`npm uninstall`卸载npm软件包「建议收藏」

卸载npm和安装npm_使用`npm uninstall`卸载npm软件包「建议收藏」

作者头像
全栈程序员站长
发布2022-07-25 21:32:01
发布2022-07-25 21:32:01
3.3K00
代码可运行
举报
运行总次数:0
代码可运行

大家好,又见面了,我是你们的朋友全栈君。

卸载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> ,请运行

代码语言:javascript
代码运行次数:0
复制
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标志将其从文件中删除:

代码语言:javascript
代码运行次数:0
复制
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标志:

代码语言:javascript
代码运行次数:0
复制
npm uninstall -g <package-name>

for example:

例如:

代码语言:javascript
代码运行次数:0
复制
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

发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/127908.html原文链接:https://javaforall.cn

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2022年4月1,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档