npm命令选项
选项 说明
search 在存储库中查找模块包 npm search express
install 使用在存储库或本地位置上的一个package.json文件来安装包 npm install
install -g 在全局可访问的位置安装一个包 npm install express -g
uninstall 卸载一个模块 npm uninstall express
remove 删除一个模块
pack 把在一个package.json文件中定义的模块封装成.tgz文件 npm pack
view 显示模块的详细信息 npm view express
publish 把在一个package.json文件中定义的模块发布到注册表 npm publish
unpublish 取消发布您已发布到注册表的一个模块(在某些情况下,还需使用 --force 选项) npm unpublish myModule
owner 允许您在存储库中添加、删除包和列出包的所有者 npm add <username> myModule
whoami (根据指定注册表模块)打印用户名 npm whoami
adduser 将用户信息添加到当前的开发环境 npm adduser
login 等同于adduser npm login
logout 将用户信息从当前的开发环境中清除 npm logout
init 初始化Node包的信息,会创建package.json文件 npm init