0

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
BugBuddy
  • 576
  • 2
  • 5
  • 19
  • Please search this site for *[bash] command not found* and see if one of the search results helps. It's always good to learn the basics of using your operating system before you start writing code. – Ken White Dec 19 '18 at 01:02

1 Answers1

1

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.

BugBuddy
  • 576
  • 2
  • 5
  • 19
  • Where did yarn install the files? Is this path in the `PATH` environment variable? If it's not, then that could be the problem. NPM adds itself to the PATH AFAIK, so that you can run tools that install themselves in the NPM folder. If yarn doesn't do that by default, then you either need to change the environment variable or specify the full path to the command or file to execute. – CodeManX Dec 19 '18 at 09:27
  • 1
    I found this: yarn global add doesn't install binaries properly · Issue #648 · yarnpkg/yarn · GitHub https://github.com/yarnpkg/yarn/issues/648 – BugBuddy Dec 20 '18 at 23:52