简体   繁体   English

如何使用 npx 在没有全局安装的情况下从包运行 cli 命令

[英]How to run cli command from package without global install using npx

I'm trying to run a cli command from @foal/cli using npx to avoid global installation.我正在尝试使用 npx 从@foal/cli运行 cli 命令以避免全局安装。

Following the docs I should do the following:按照文档,我应该执行以下操作:

$ npm install -g @foal/cli

$ foal createapp my-app

I'm trying to use npx to avoid global installation of package.我正在尝试使用npx来避免全局安装包。

Following this article I tried the following:这篇文章之后,我尝试了以下内容:

$ npx -package @foal/cli foal createapp foal-test
npx: installed 203 in 27.122s
'foal' is not recognized as an internal or external command,
operable program or batch file.

Any idea how to achieve this?知道如何实现这一目标吗?

它应该是npx --packagenpx --package npx -p简称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM