什么是npx(官方文档权威解读)

npx

What is NPX?

NPX is an NPM package executor. Initially, NPX was launched in July 2017. NPX was just an NPM package that could be installed like other NPM packages. Currently, NPX is bundled with NPM when you install the NPM version 5.2.0 or higher.

Using NPX

With NPX, you can run and execute packages without having to install them locally or globally.

When running NPM executables with NPX, if a package is installed, NPX will search for the package binaries (either locally or globally) and then run the package.

If the package was not previously installed, NPX will not install the package in your system; instead, it will create a temporary cache that will hold the package binaries. Once the execution is over, NPX will remove the installed cache binaries from the system.

中文翻译:

什么是NPX?

NPX是NPM包的执行者。最初,NPX于2017年7月推出.NPX只是一个可以像其他NPM软件包一样安装的NPM软件包。目前,在安装NPM 5.2.0或更高版本时,NPX与NPM捆绑在一起。

使用NPX

使用NPX,您可以运行和执行软件包,而无需在本地或全局安装它们。

使用NPX运行NPM可执行文件时,如果安装了包,NPX将搜索包二进制文件(本地或全局),然后运行包。

如果之前未安装该软件包,NPX将不会在您的系统中安装该软件包;相反,它将创建一个临时缓存来保存包二进制文件。一旦执行结束,NPX将从系统中删除已安装的缓存二进制文件。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值