Skip to content

Every vue cli command hangs #5310

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
peschee opened this issue Mar 24, 2020 · 4 comments · Fixed by #5315
Closed

Every vue cli command hangs #5310

peschee opened this issue Mar 24, 2020 · 4 comments · Fixed by #5315

Comments

@peschee
Copy link

peschee commented Mar 24, 2020

Version

4.2.3

Environment info

node: 10.16.3
npm: 6.9.0
osx: 10.15.3
shell: zsh

Steps to reproduce

  • npm install -g @vue/cli
  • run vue info or vue --version

What is expected?

  • vue info outputs the environment information
  • vue --version outputs the vue cli version

What is actually happening?

Both commands hang and do not output anything.


I also tried this with npm install -g @vue/[email protected] but the problem remains almost the same. vue --version outputs the version, vue info only outputs

Environment Info:

but nothing more and hangs.

Anybody with any ideas why this might be happening?

@haoqunjiang
Copy link
Member

Don't use vue-cli. It does not support the vue info command, thus outputting nothing.

As for @vue/cli, I'm not sure what the problem. But could you try to run npx envinfo? The vue info command depends on that package to collect the environment information. So if it works, there's a problem in @vue/cli; otherwise, the bug is in the envinfo package.

@peschee
Copy link
Author

peschee commented Mar 24, 2020

@sodatea I have adapted the description. I'm not using vue-cli, but @vue/cli, sorry for that confusion. The problem is not with the info command of vue cli, but the cli in general. I cannot run any command for that matter. I noticed this when using the vue-cli-service in our project.

That command stopped working so right now, I cannot build, serve, test etc. the project. I narrowed it down to the fact that all vue ... commands also hang on my machine. Cannot figure out why unfortunately.

EDIT: I noticed that npx envinfo hangs as well… The command does not give me any additional information, I noticed in the iTerm title bar that it hangs when the mdfind command runs.

EDIT 2: So the issue seems to be with mdfind. When I run killall mdfind (either once or a couple of times), the vue --version command finishes and returns @vue/cli 4.2.3. I'll have to investigate further.

@haoqunjiang
Copy link
Member

Well that must be the culprit.
I don't know why mdfind hangs on your machine but there is a bug in the current @vue/cli implementation that it tried to get the browser version when not necessary. A similar bug was reported recently too #5286 (comment)

Maybe it's because the Spotlight index hasn't been successfully built in your system?

Anyway, the workaround is to modify the installed @vue/cli source code to stop this getter from running.

if (hasCheckedBrowsers) {
return browsers
}
(if (hasCheckedBrowsers) -> if (true))

@peschee
Copy link
Author

peschee commented Mar 25, 2020

I was able to narrow down my issue. The problem was that the mdfind command, which vue cli (or vue-cli-service for that matter) seems to use was running too long on my machine (more or less endlessly…).

I used the following command $ mdfind -name stdlib.h for testing. The issue for me was that I had referenced to mounted drives ~/Library/Containers and Spotlight seemed to be indexing these directories. Therefore, the mdfind command was blocking the execution of all vue cli / cli service commands.

I explicitely excluded ~/Library/Containers from the Spotlight index. The vue commands work now as expected.

EDIT: the npx envinfo command was blocked as well before and is now working as expected.

haoqunjiang added a commit that referenced this issue Mar 31, 2020
* fix: add a timeout, avoid process hanging

fixes #5310

* fix: avoid accidentally trigerring the `installedBrowsers` getter

fixes #5286
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants