Cannot install Compose DB CLI

Hello! I was working through this tutorial about ComposeDB and I’m getting an error when running

composedb did:generate-private-key

bash: composedb: command not found

I’ve gone through the install steps twice, and tried restarting my terminal and running again. You can see the package.json and package-lock.json file here
I’m seeing this error on a package which seems to want me to downgrade my vesion of node.

npm install --location=global @composedb/cli@^0.3.0
npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'nist-weierstrauss@1.5.1',
npm WARN EBADENGINE   required: { node: '>=14.06' },
npm WARN EBADENGINE   current: { node: 'v16.14.2', npm: '8.5.0' }
npm WARN EBADENGINE }
npm WARN deprecated multibase@4.0.6: This module has been superseded by the multiformats module

added 438 packages, and audited 439 packages in 9s

70 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
2 Likes

for me, I was not able to install globally either (you should see a fatal error in that step)

I am using npm -v 8.11.0 and on a macbook with Intel.

I just installed it locally to test, further but I’ve had quite a few issues so want to follow this as well.

2 Likes

Currently running into the same issue. Tried all the things mentioned by OP, as well as changing different node versions but nothing helped so far.

3 Likes

@paul could you take a look at this?

@jpvajda from the logs you’re showing it seems the installation was successful, no?

I don’t know what can be the cause of your issue but it most likely has to do with your local node/npm setup, maybe not having the binaries lookup paths correctly set?

1 Like

Thanks for the tip @paul. I’m not super familiar with how to check my binary look up paths, is there any documentation on that you could reference?

Hey zitzak, can you share more about the error?

1 Like

So I was able to solve it, at least the point where I got the initial error. It was some overside/inexperience on my side.

Because the command listed here always returned zsh: command not found: composedb, I assumed that this happened because during the installation process I got this error, no matter if I switched node or npm package:

npm WARN EBADENGINE Unsupported engine {
npm WARN EBADENGINE   package: 'nist-weierstrauss@1.5.1',
npm WARN EBADENGINE   required: { node: '>=14.06' },
npm WARN EBADENGINE   current: { node: 'v18.0.0', npm: '8.6.0' }
npm WARN EBADENGINE }

My mistake here was that I literally copy => paste the command that references the composedb lib because somehow in my mind I associated it with like a shell program. As soon as I added npm/yarn upfront it worked :man_facepalming:

Thanks however for the quick and active responses to the thread from the community

1 Like

For whoever might have a similar issue, I ended up installing the cli as a devDependency instead of the documented pnpm add -g @composedb/cli@^0.3.0 I do pnpm add -D @composedb/cli@^0.3.0. Then, within my package.json, I add a pnpm script like the following:

    "echo:did": "composedb did:from-private-key $(cat local.key)",

Then I run from my terminal pnpm run echo:did, which simplifies my workflow and will eventually be helpful for any CI/CD setup in the future.

1 Like

Based on some of the comments above about the documentation commands just being incorrect I was able to fix my issue where I was getting this error after running composedb did:generate-private-key

Unknown command: "composedb"
111

instead of running npm install --location=global @composedb/cli@^0.3.0 which what was in the CLI documentation I just ran npm install -g @composedb/cli@^0.3.0 and then composedb did:generate-private-key

Which finally ran successfully. :partying_face:

✔ Generating random private key... Done!
xxxxxxx
1 Like