npm-uninstall
选择命令行版本:
See Details
目录
概要
¥Synopsis
npm uninstall [<@scope>/]<pkg>...aliases: unlink, remove, rm, r, un
描述
¥Description
这将卸载一个包,完全删除代表它安装的所有 npm。
¥This uninstalls a package, completely removing everything npm installed on its behalf.
它还会从 package.json
中的 dependencies
、devDependencies
、optionalDependencies
和 peerDependencies
对象中删除包。
¥It also removes the package from the dependencies
, devDependencies
, optionalDependencies
, and peerDependencies
objects in your package.json
.
此外,如果你有 npm-shrinkwrap.json
或 package-lock.json
,npm 也会更新这些文件。
¥Further, if you have an npm-shrinkwrap.json
or package-lock.json
, npm will update those files as well.
--no-save
会告诉 npm 不要从你的 package.json
、npm-shrinkwrap.json
或 package-lock.json
文件中删除包。
¥--no-save
will tell npm not to remove the package from your package.json
, npm-shrinkwrap.json
, or package-lock.json
files.
--save
或 -S
将告诉 npm 从你的 package.json
、npm-shrinkwrap.json
和 package-lock.json
文件中删除该包。这是默认设置,但如果你的 npmrc
文件中有例如 save=false
,你可能 需要使用它
¥--save
or -S
will tell npm to remove the package from your package.json
, npm-shrinkwrap.json
, and package-lock.json
files. This is the default, but you may need to use this if you have for instance save=false
in your npmrc
file
在全局模式下(即,将 -g
或 --global
附加到命令中),它将当前包上下文作为全局包卸载。在这种情况下,--no-save
被忽略。
¥In global mode (ie, with -g
or --global
appended to the command), it uninstalls the current package context as a global package. --no-save
is ignored in this case.
范围是可选的,并遵循 scope
的通常规则。
¥Scope is optional and follows the usual rules for scope
.