yarn/npm常用命令

------------yarn常用命令-------------
开始一个新工程
yarn init
添加一个依赖
yarn add [package]
yarn add [package]@[version]
yarn add [package]@[tag]
更新一个依赖
yarn upgrade [package]
yarn upgrade [package]@[version]
yarn upgrade [package]@[tag]
移除一个依赖
yarn remove [package]
安装package.json中所有的依赖项
yarn
或者为
yarn install

--------------npm常用命令-------------
安装模块
npm install (with no args, in package dir)
npm install [<@scope>/]
npm install [<@scope>/]@
npm install [<@scope>/]@
npm install [<@scope>/]@
npm install
npm install
npm install
本地安装(local)
npm install gulp
全局安装(global),使用 -g 或 --global
npm install gulp -g

卸载模块
npm uninstall [<@scope>/][@]… [-S|–save|-D|–save-dev|-O|–save-optional]
aliases: remove, rm, r, un, unlink

更新模块
npm update [-g] […]

检查模块是否已经过时
npm outdated [[<@scope>/] …]

查看安装的模块
npm ls [[<@scope>/] …]
aliases: list, la, ll

在项目中引导创建一个package.json文件
npm init [-f|–force|-y|–yes]

查看某条命令的详细帮助
npm help [<terms…>]

查看包的安装路径
npm root [-g]

管理npm的配置路径
npm config set [-g|–global]
npm config get
npm config delete
npm config list
npm config edit
npm get
npm set [-g|–global]

管理模块的缓存
npm cache add
npm cache add
npm cache add
npm cache add @
npm cache ls [ ]
npm cache clean [ ]

启动模块
npm start [-- ]

停止模块
npm stop [-- ]

重新启动模块
npm restart [-- ]

测试模块
npm test [-- ]
npm tst [-- ]

查看模块版本
npm version [ | major | minor | patch | premajor | preminor | prepatch | prerelease | from-git]

查看模块的注册信息
npm view [<@scope>/][@] [[.]…]
aliases: info, show, v

用户登录
npm adduser [–registry=url] [–scope=@orgname] [–always-auth]

发布模块
npm publish [|] [–tag ] [–access <public|restricted>]

在发布的包上设置访问级别
npm access public []
npm access restricted []
npm access grant <read-only|read-write> scope:team []
npm access revoke scope:team []
npm access ls-packages [||scope:team]
npm access ls-collaborators [ []]
npm access edit []

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值