You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After cloning the AsyncAPI CLI repository and attempting to execute it's commands, an error (attached as a screenshot) is encountered.
However, installing AsyncAPI CLI via npm npm install -g @asyncapi/cli works fine.
Environment
Node.js Version: 20.13.1
npm Version 10.5.2
Possible Issues
I tried updating the dependencies using: npm outdated->npm i -g npm-check-updates->ncu-u->npm install
It seems related to how oclifHandler is used in bin/run_bin.js.
oclif version mismatch.
Expected behavior
The commands executed from the cloned repository should function the same as those from the globally installed version npm install -g @asyncapi/cli, without encountering any TypeErrors.
Screenshots
How to Reproduce
Fork & clone the repository
cd to cli directory
Install Dependencies: npm install
Linked the package globally: npm link
Verify Installation (Passed in my case): asyncapi --version
Welcome to AsyncAPI. Thanks a lot for reporting your first issue. Please check out our contributors guide and the instructions about a basic recommended setup useful for opening a pull request. Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.
This is not a bug. The reason is that using npm link creates a symlink of run_bin.js which is set to use the Production environment. Production environment has many restrictions including preventing you from running code on raw .ts files, which is why you should either build using npm run build or if you're actively editing the code you can run npm run dev to create a dev server.
I was using ./bin/run_bin [Commands] as an alternative but after doing the required oclif handler changes in run_bin file it worked fine!
Thanks @Ervishalpathak7
Description:
After cloning the AsyncAPI CLI repository and attempting to execute it's commands, an error (attached as a screenshot) is encountered.
However, installing AsyncAPI CLI via npm
npm install -g @asyncapi/cli
works fine.Environment
Possible Issues
npm outdated
->npm i -g npm-check-updates
->ncu-u
->npm install
oclif
version mismatch.Expected behavior
The commands executed from the cloned repository should function the same as those from the globally installed version
npm install -g @asyncapi/cli
, without encountering any TypeErrors.Screenshots
How to Reproduce
npm install
npm link
asyncapi --version
🥦 Browser
Google Chrome
👀 Have you checked for similar open issues?
🏢 Have you read the Contributing Guidelines?
Are you willing to work on this issue ?
Yes I am willing to submit a PR!
The text was updated successfully, but these errors were encountered: