Repository navigation
Closed
Labels
bugSomething isn't working
Description
Describe the bug
I get this error:
$ ./node_modules/.bin/asyncapi start:studio
(node:89108) [MODULE_NOT_FOUND] Error Plugin: @asyncapi/cli: Cannot find module '@oclif/plugin-help/lib/command'
Require stack:
- /Users/m/PhpstormProjects/spec/examples/social-media/node_modules/@fmvilas/oclif-plugin-spaced-commands/lib/hooks/init.js
- /Users/m/PhpstormProjects/spec/examples/social-media/node_modules/@oclif/config/lib/config.js
- /Users/m/PhpstormProjects/spec/examples/social-media/node_modules/@oclif/config/lib/index.js
- /Users/m/PhpstormProjects/spec/examples/social-media/node_modules/@oclif/command/lib/command.js
- /Users/m/PhpstormProjects/spec/examples/social-media/node_modules/@oclif/command/lib/index.js
- /Users/m/PhpstormProjects/spec/examples/social-media/node_modules/@asyncapi/cli/bin/run
module: @oclif/[email protected]
task: runHook init
plugin: @asyncapi/cli
root: /Users/m/PhpstormProjects/spec/examples/social-media/node_modules/@asyncapi/cli
See more details with DEBUG=*
(Use `node --trace-warnings ...` to show where the warning was created)
Studio is running at http://localhost:3210?liveServer=3210
Watching changes on file asyncapi.yaml
but browser opens up and shows message 404 - The requested path could not be found
How to Reproduce
- installed locally/globally using
npm install @asyncapi/cli - when I got first error with oclif, I added more packages.
{
"dependencies": {
"@asyncapi/cli": "^0.14.1",
"@oclif/command": "^1.8.16",
"@oclif/plugin-help": "^5.1.11",
"oclif": "^2.4.5"
}
}
- run
./node_modules/.bin/asyncapi start:studioor./node_modules/.bin/asyncapi new
the guide to create a new file works and I can verify that a new file was created.
macOS Monterey, node - v17.6.0, npm - 8.5.1
Expected behavior
It will open a studio in the browser with the studio.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
github-actions commentedon Feb 23, 2022
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.
Souvikns commentedon Feb 23, 2022
@aykonsvk currently CLI shows this warning in production but the development environment works fine you can check this #192 I already have this updated oclif to its latest version which you can check #203 , we haven't merged this yet since some other PR's will break so waiting for now.
I am having issue reproducing the bug , I installed the CLI globally and then ran the commands, so my commands look something like this
asyncapi newandasyncapi start:studio -f ./asyncapi.yamland they are working as intended but I still see the warnings.Also can you try running
asyncapi start:studio -f ./path-to-asyncapi-file. Let me know if you still face the problem.aykonsvk commentedon Mar 1, 2022
I tried it when installed @asyncapi/cli as devDependency locally or globally using the mentioned command above and the result was same. Error and 404.
imabp commentedon Mar 8, 2022
As @Souvikns mentioned, we are waiting for PRs to get merged, to make sure, this error resolves in to production release.
But for now, @aykonsvk feel free to follow these steps to run locally.
<command>= validate, new, diff, etc<flags= -w, -h , etc<path>= if any command (for ex: diff / validate) requires path.Souvikns commentedon Mar 11, 2022
@aykonsvk can you update to the latest version and check once, your issue should be fixed now, but if it isn't just let me know.
aykonsvk commentedon Mar 19, 2022
After the update there is no error in the console. but I still have 404.
Tried new file with
And also opening existing with full path:
derberg commentedon Mar 23, 2022
@aykonsvk I just installed latest CLI
All works well for me. I replicated all your steps and see no issues. I see you are working on sources, can you please make sure you are really using latest?
andrew-williams-cko commentedon Apr 21, 2022
I also had this 404 issue - but it seems to only happen when
@asyncapi/cliis installed locally, when installed globally (npm i -g), it seems to work fine.aykonsvk commentedon Apr 22, 2022
@andrew-williams-cko Thank you! That helped. Tried to reproduce the problem even in docker and it is not working when package is not globally installed.
derberg commentedon Apr 26, 2022
just to clarify @aykonsvk @andrew-williams-cko do you see a use case to use CLI as a local package?
andrew-williams-cko commentedon Apr 26, 2022
Mainly for convinience, as adding an extra step on Getting Started for potential contributors isn't ideal, but then again, it's just one tiny extra step, so not a deal breaker.
derberg commentedon May 9, 2022
Mainly for convinienceoh yeah, actually for good DX it makes sense to enable support for it. I on my own userimrafquite a lot and can imagine that you have some script inpackage.jsonlikenpm run validateor something.So yeah, this is not yet fixed, we need to investigate what's wrong
derberg commentedon May 12, 2022
ok folks, so
"@asyncapi/cli": "^0.19.1"todevDependenciesin my project"studio": "asyncapi --version && asyncapi start studio"npm run studioMaybe you have some ports opened? did you try
pflag with a custom port? Hard to fix without reproducing, or did I misunderstand your use case?Pcrab commentedon May 15, 2022
I found if I install with npm globally,
start:studioworks, but if I use yarn or pnpm, it will always return a 404.derberg commentedon May 17, 2022
I tried with the latest CLI, installed in my project as a local dependency with YARN and all is good.
I really cannot reproduce it.
The error looks like connected to https://github.com/asyncapi/cli/blob/master/src/models/Studio.ts#L49. Maybe because of some issues on your side, the
@asyncapi/studiodependency is not installed, therefore the server cannot host anything from../../node_modules/@asyncapi/studio/build. This is my only suspicion as I cannot reproduce. I really do not know 😞mihirkothari25 commentedon Jun 9, 2022
I ran into the same issue with pnpm. Installed it as a dev dependency at both the root level and the package level and encountered a 404 when running studio.
It works fine with the global installation of the cli.
derberg commentedon Jun 9, 2022
@mihirkothari25
can you confirm if
node_modulesinside installed@asyncapi/cliyou have@asyncapi/studio?mihirkothari25 commentedon Jun 9, 2022
@derberg I doesn't contain it.

derberg commentedon Jun 9, 2022
Damn, it is almost completely empty 🤔 at least we know why we get the error, but why the heck deps are not resolved by pnpn...
... looking at docs
Looks like it is normal. That if you installed it also globally, it is the only place where it stays and won't go to local package 🤔 but there is also no symlink so what magic is used to import deps... I have no idea 🤣
We need to figę how we can fallback to global location, or in different words, how to safely resolve "build" path relative to node_modules
derberg commentedon Jun 21, 2022
@mkotharicvent I don't think we need to reproduce. We know issue is related to this line -> https://github.com/asyncapi/cli/blob/master/src/models/Studio.ts#L49 and that in case of
pnpm, prod dependencies are not installed for the CLI (as they are in global location, thus picked up from there) so@asyncapi/studiois not installed in the same directory, thus server serves nothing.Easiest but ugliest solution:
buildfile doesn't exist, the server will not start and proper console error will be thrown with an explanationSomething better from UX point of view:
@asyncapi/studioon a drive, and host from given location, no matter if npm, pnpm or yarn is usedbuildfile from thestudioduring the release and place in thedistdirAn approach with better release process might make more sense 🤔 then
@asyncapi/studiowould be just adevDependency.What do you think?
woylie commentedon Jun 23, 2022
I just tried adding the cli (version 0.19.4) as a dev dependency to a yarn 1.22.18 project (no pnpm). I generated a new file with
asyncapi new, but when I started studio, I got "404 - The requested path could not be found" in the browser as well.It looks like the dependencies have been installed, though:
I then tried to install the cli globally with yarn, but I got the same result.
derberg commentedon Jun 28, 2022
@magicmatatjahu @Souvikns @boyney123
Hey folks, what do you think about #244 (comment) and 👇🏼
I think we should give it a try and not depend on dependencies and all these different package managers
github-actions commentedon Oct 27, 2022
This issue has been automatically marked as stale because it has not had recent activity 😴
It will be closed in 120 days if no further activity occurs. To unstale this issue, add a comment with a detailed explanation.
There can be many reasons why some specific issue has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.
Let us figure out together how to push this issue forward. Connect with us through one of many communication channels we established here.
Thank you for your patience ❤️
tsauerwein commentedon Feb 10, 2023
The issue still exists with version
0.31.0. If I install the package locally withnpm install @asyncapi/cli, I still see a 404 in the browser.To reproduce:
Installing it globally works.