简体   繁体   中英

running Foxx-cli on linux — foxx: command not found

I'm following the instructions for installing foxx-cli here: arangodb/foxx-cli: CLI for managing Foxx services .

specifically, I did these steps:

sudo pacman -S nodejs yarn
yarn global add foxx-cli

success Installed "foxx-cli@1.3.0" with binaries:
- foxx
Done in 13.33s.

The next step in the instructions is:

$ foxx --help

I get:

-bash: foxx: command not found

I also tried foxx-cli and it is also not found. Trying another way:

$ node
> foxx
ReferenceError: foxx is not defined

trying things from other tutorials hasn't helped. For example, I tried this command in node:

> db = new Database('http://192.168.1.1:8529');
ReferenceError: Database is not defined

As you can see, I have never used node before. There must be something very basic missing from the instructions, something that anyone familiar with node would know to do. But looking around at node tutorials hasn't revealed to me what step I'm missing.

More info:

node --version
v11.4.0

sudo uname -a
Linux 4.19.4-arch1-1-ARCH #1 SMP PREEMPT Fri Nov 23 09:06:58 UTC 2018 x86_64 GNU/Linux

An alternative way to install Foxx Microservices, as suggested in the tutorial, is:

npm install --global foxx-cli

I have not used nodejs or yarn before, but in hindsight it is clear that yarn failed even though it reported success:

success Installed "foxx-cli@1.3.0" with binaries

It was not, in fact, installed successfully. Rather than troubleshoot yarn , I tried npm.

After installing with npm, running the suggested command succeeds:

foxx --help

The tutorial did not make it clear whether foxx was executable from the shell prompt or within nodejs. Once properly installed, it does execute from the shell prompt.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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