0

I have an issue with a binary(?) that simultaneously seems to exist and not exist.

$ ls -l /usr/local/bin/vue
lrwxr-xr-x  1 myusername  admin  73 Jul 14 15:31 /usr/local/bin/vue -> ../../../Users/myusername/.config/yarn/global/node_modules/vue-cli/bin/vue
$ /usr/local/bin/vue
zsh: no such file or directory: /usr/local/bin/vue

Any idea what's going on here?

  • Most probably you deleted the target file after linking it with /usr/local/bin/vue – Prvt_Yadav Jul 14 '18 at 14:05
  • If you see this when running a shell script, it might be because of \r\n line endings that can be fixed by dos2unix. See stackoverflow.com/a/38193054/6517383 – Black Mamba Oct 7 '18 at 9:49
7

You will find that /Users/myusername/.config/yarn/global/node_modules/vue-cli/bin/vue does not exist.

The symbolic link /usr/local/bin/vue exists, so you can see it with ls -l. But the target does not, so there's not really any file there.

You can confirm this with either of these two commands

ls -lL /usr/local/bin/vue
ls -l /usr/local/bin/../../../Users/myusername/.config/yarn/global/node_modules/vue-cli/bin/vue

The first tells ls to give you information about the target of the link rather than the link itself (-L). The second looks directly at the target.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.