首页 > 其他分享 >【npm】npm命令

【npm】npm命令

时间:2023-03-02 16:33:00浏览次数:37  
标签:npm ... -- access 命令 install aliases


root@basic-services:~# npm -l

Usage: npm <command>

where <command> is one of:

access 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>]

adduser npm adduser [--registry=url] [--scope=@orgname] [--auth-type=legacy] [--always-auth]

aliases: login, add-user

audit
npm audit [--json] [--production]
npm audit fix [--force|--package-lock-only|--dry-run|--production|--only=(dev|prod)]

bin npm bin [--global]

bugs npm bugs [<pkgname>]

alias: issues

cache npm cache add <tarball file>
npm cache add <folder>
npm cache add <tarball url>
npm cache add <git url>
npm cache add <name>@<version>
npm cache clean
npm cache verify

ci npm ci

completion source <(npm completion)

config npm config set <key> <value>
npm config get [<key>]
npm config delete <key>
npm config list [--json]
npm config edit
npm set <key> <value>
npm get [<key>]

alias: c

dedupe npm dedupe

aliases: ddp, find-dupes

deprecate npm deprecate <pkg>[@<version>] <message>

dist-tag npm dist-tag add <pkg>@<version> [<tag>]
npm dist-tag rm <pkg> <tag>
npm dist-tag ls [<pkg>]

alias: dist-tags

docs npm docs <pkgname>
npm docs .

alias: home

doctor npm doctor

edit npm edit <pkg>[/<subpkg>...]

explore npm explore <pkg> [ -- <command>]

fund npm fund [--json]

common options: npm fund [--browser] [[<@scope>/]<pkg> [--which=<fundingSourceNumber>]

get npm get <key> <value> (See `npm config`)

help

help-search npm help-search <text>

hook

init
npm init [--force|-f|--yes|-y|--scope]
npm init <@scope> (same as `npx <@scope>/create`)
npm init [<@scope>/]<name> (same as `npx [<@scope>/]create-<name>`)

aliases: create, innit

install
npm install (with no args, in package dir)
npm install [<@scope>/]<pkg>
npm install [<@scope>/]<pkg>@<tag>
npm install [<@scope>/]<pkg>@<version>
npm install [<@scope>/]<pkg>@<version range>
npm install <alias>@npm:<name>
npm install <folder>
npm install <tarball file>
npm install <tarball url>
npm install <git:// url>
npm install <github username>/<github project>

aliases: i, isntall, add
common options: [--save-prod|--save-dev|--save-optional] [--save-exact] [--no-save]

install-ci-test
npm install-ci-test [args]
Same args as `npm ci`

alias: cit

install-test
npm install-test [args]
Same args as `npm install`

alias: it

link npm link (in package dir)
npm link [<@scope>/]<pkg>[@<version>]

alias: ln

logout npm logout [--registry=<url>] [--scope=<@scope>]

ls npm ls [[<@scope>/]<pkg> ...]

aliases: list, la, ll

org npm org set orgname username [developer | admin | owner]
npm org rm orgname username
npm org ls orgname [<username>]

outdated npm outdated [[<@scope>/]<pkg> ...]

owner npm owner add <user> [<@scope>/]<pkg>
npm owner rm <user> [<@scope>/]<pkg>
npm owner ls [<@scope>/]<pkg>

alias: author

pack npm pack [[<@scope>/]<pkg>...] [--dry-run]

ping npm ping
ping registry

prefix npm prefix [-g]

profile npm profile enable-2fa [auth-only|auth-and-writes]
npm profile disable-2fa
npm profile get [<key>]
npm profile set <key> <value>

prune npm prune [[<@scope>/]<pkg>...] [--production]

publish npm publish [<tarball>|<folder>] [--tag <tag>] [--access <public|restricted>] [--dry-run]

Publishes '.' if no argument supplied

Sets tag `latest` if no --tag specified

rebuild npm rebuild [[<@scope>/<name>]...]

alias: rb

repo npm repo [<pkg>]

restart npm restart [-- <args>]

root npm root [-g]

run-script npm run-script <command> [-- <args>...]

aliases: run, rum, urn

search npm search [--long] [search terms ...]

aliases: s, se, find

set npm set <key> <value> (See `npm config`)

shrinkwrap npm shrinkwrap

star npm star [<pkg>...]
npm unstar [<pkg>...]

alias: unstar

stars npm stars [<user>]

start npm start [-- <args>]

stop npm stop [-- <args>]

team npm team create <scope:team> [--otp <otpcode>]
npm team destroy <scope:team> [--otp <otpcode>]
npm team add <scope:team> <user> [--otp <otpcode>]
npm team rm <scope:team> <user> [--otp <otpcode>]
npm team ls <scope>|<scope:team>
npm team edit <scope:team>

test npm test [-- <args>]

aliases: tst, t

token npm token list
npm token revoke <tokenKey>
npm token create [--read-only] [--cidr=list]


uninstall npm uninstall [<@scope>/]<pkg>[@<version>]... [--save-prod|--save-dev|--save-optional] [--no-save]

aliases: un, unlink, remove, rm, r

unpublish
npm unpublish [<@scope>/]<pkg>@<version>
npm unpublish [<@scope>/]<pkg> --force

update npm update [-g] [<pkg>...]

aliases: up, upgrade, udpate

version npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease [--preid=<prerelease-id>] | from-git]
(run in package dir)
'npm -v' or 'npm --version' to print npm version (6.14.12)
'npm view <pkg> version' to view a package's published version
'npm ls' to inspect current package/dependency versions

view npm view [<@scope>/]<pkg>[@<version>] [<field>[.subfield]...]

aliases: v, info, show

whoami npm whoami [--registry <registry>]
(just prints username according to given registry)

npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview

Specify configs in the ini-formatted file:
/root/.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

 

标签:npm,...,--,access,命令,install,aliases
From: https://blog.51cto.com/u_13128132/6096426

相关文章

  • 【npm】基础
    0、一个项目如果依赖某些npmpackage,那么该项目本身就是一个npmpackage。1、一个npmpackage需要有package.jsonREADME.mdLISCENSE.mdindex.js文件,并且npminit时信息要......
  • 【npm】在Ubuntu1804部署Verdaccio
    1、创建verdaccio系统用户:$sudoadduser--system--gecos'VerdaccioNPMmirror'--group--home/var/lib/verdaccioverdaccio 2、切换到该用户,并且切入该用户的家目......
  • dos命令
    #盘符切换cd/dd:\user\文件#查看当前目录下的所有文件dir#清理屏幕cls(clearscreen)#退出终端exit#查看IPipconfig#打开应用calcmspaintnotepad#pingpingwww.baidu.co......
  • KingbaseES V8R6 集群运维系列 -- 命令行部署repmgr管理集群+switchover测试
    本次部署未使用securecmd/kbha工具,无需普通用户到root用户的互信。一、环境准备1、创建OS用户建立系统数据库安装用户组及用户,在所有的节点执行。root用户登陆服务器,创......
  • 【ZooKeeper基础-数据结构、服务端/客户端常用命令】
    一、ZooKeeper简介二、ZooKeeper数据结构&命令**1、数据结构**2、服务端常用命令①单机启动命令:./zkServer.shstart②状态查询命令:./zkServer.shstatus③停止服务......
  • linux常用命令
    1.man[命令或配置文件](功能描述:获得帮助信息)获取一个信息文档,查看具体信息,按q退出2.help命令(功能描述:获得shell内置命令的帮助信息)仅仅能获取bash内置命令的信息,不......
  • MySQL数据库常用操作命令
    MySQL数据库常用操作命令登录mysql数据库:mysql-uuser-ppassword。user表示用户名、password表示登录密码。创建数据库:createdatabasecainiao;cainiao表示创建的数......
  • Linux中的常用命令
    Linux中的命令严格区分大小写pwd printworkingdirectory:输出当前工作目录,光标所有位置的目录(绝对路径)cd changedirectory:’切换目录 ‘.’表示当前目当‘........
  • Linux中的常用命令
    Linux中的命令严格区分大小写pwd printworkingdirectory:输出当前工作目录,光标所有位置的目录(绝对路径)cd changedirectory:’切换目录 ‘.’表示当前目当‘........
  • Linux中的常用命令
    Linux中的命令严格区分大小写 pwd printworkingdirectory:输出当前工作目录,光标所有位置的目录(绝对路径)cd changedirectory:’切换目录 ‘.’表示当前目当......