libp2p / js-peer-id

peer-id implementation in JavaScript. Deprecated; use https://github.com/libp2p/js-libp2p-peer-id instead.
https://github.com/libp2p/js-libp2p-peer-id
MIT License
80 stars 44 forks source link

peer-id CLI does not exist #164

Closed mgwidmann closed 2 years ago

mgwidmann commented 2 years ago

Documentation states:

> peer-id --type rsa --bits 2048

However, its not available globally nor is it in the local installation:

$ npm install -g peer-id
$ npm install peer-id
$ peer-id --type rsa --bits 2048
bash: peer-id: command not found
$ ls node_modules/.bin/peer-id
ls: node_modules/.bin/peer-id: No such file or directory
$ npx peer-id --type rsa --bits 2048
npm ERR! could not determine executable to run

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/mgwidmann/.npm/_logs/2022-01-13T21_13_44_189Z-debug.log

This is because there is no peer-id executable in the project.

$ tree node_modules/peer-id/ -a
node_modules/peer-id/
├── LICENSE
├── README.md
├── dist
│   └── index.min.js
├── node_modules
│   └── .bin
│       ├── pbjs -> ../../../protobufjs/bin/pbjs
│       └── pbts -> ../../../protobufjs/bin/pbts
├── package.json
└── src
    ├── index.d.ts
    ├── index.js
    ├── proto.d.ts
    ├── proto.js
    └── proto.proto

4 directories, 11 files

Where is the CLI?

vasco-santos commented 2 years ago

It looks like it was removed recently: https://github.com/libp2p/js-peer-id/pull/160

aewing commented 2 years ago

I made a package for anyone that needs this cli: https://www.npmjs.com/package/peer-id-bin