npm CLI(一)

2022-02-08  本文已影响0人  small_zeo

定义

npm 是世界最大的软件注册中心。全世界的开源开发者使用npm来共享、借用软件包,许多组织也使用npm 管理私有开发。
npm 由三部分组成:

使用npm

CLI Commands

npm <command> [args]

运行 npm help 可以等到可用命令列表

image.png

如果一个包使用git URL列出了一个依赖项,npm将使用git命令安装该依赖项,如果没有安装,npm将生成一个错误。

npm access public [<package>]
npm access restricted [<package>]
npm access grant <read-only|read-write> <scope:team> [<package>]
npm access revoke <scope:team> [<package>]
npm access 2fa-required [<package>]
npm access 2fa-not-required [<package>]
npm access ls-packages [<user>|<scope>|<scope:team>]
npm access ls-collaborators [<package> [<user>]]
npm access edit [<package>]
npm adduser [--registry=url] [--scope=@orgname] [--auth-type=legacy]

aliases: login, add-user

创建或验证<username>在指定注册表中命名的用户,并将凭据保存到该.npmrc文件。如果未指定注册表,则将使用默认注册表(请参阅参考资料npm-config)。

npm audit fix

扫描项目中的漏洞并显示详细信息,而无需修复任何内容:

npm audit
npm bugs [<pkgname>]
npm cache add <tarball file>...
npm cache add <folder>...
npm cache add <tarball url>...
npm cache add <name>@<version>...
npm cache clean
aliases: npm cache clear, npm cache rm
npm cache verify
上一篇 下一篇

猜你喜欢

热点阅读