vercel / hyper

A terminal built on web technologies
https://hyper.is
MIT License
43.27k stars 3.52k forks source link

Permission denied on start #2891

Open msecret opened 6 years ago

msecret commented 6 years ago

Issue

I've installed hyper on Arch linux from the AUR, yaourt -S hyper (yaourt is one of the many package managers for the AUR. There doesn't seem to be any error messages in the install process. Once I try and run the hyper app, I get the following ,essage at startup:

running in prod mode
electron will open file:///usr/lib/hyper/resources/app.asar/index.html
Setting Hyper as default client for ssh:// protocol
Failed to symlink Hyper CLI { Error: EACCES: permission denied, unlink '/usr/local/bin/hyper'
  errno: -13,
  code: 'EACCES',
  syscall: 'unlink',
  path: '/usr/local/bin/hyper' }
Checking for notification messages
No matching notification messages

This message ^ appears in the terminal I ran hyper from. When I run a hyper command from within the hyper app, such as hyper i hyper-pane, I get the exact same error as above. This error message appears in the hyper app and opens a new hyper window. The dir /usr/local/bin is currently owned by root (which I think it should be?).

jaydh commented 6 years ago

Firstly, most people would say to drop yaourt immediately because it's insecure. I like trizen and yay but the wiki is good on this topic.

I'm on Void and I get this same error running hyper from both the AppImage and from source. Issue is certainly with hyper's own executable trying to symlink to a binary and not with the mkpkg from the aur.

jaydh commented 6 years ago

Ya so looks like hyper checks the symlink in /usr/bin/local each time it's run to see if it points to the executing AppImage to keep it in sync and will try to unlink and relink if it's pointing to the wrong location. And it just fails because it lacks permissions to symlink into /usr/local bin. Wouldn't recomment running hyper under root to fix this issue. Personally I think you would need to prompt the user for superuser permissions when hyper wants to do relinking. I don't know enough about nodejs to spawn child processes with su. This seems appealing for this use case.

Ideally though this is indicative of Linux needing more love and consideration. Linking AppImages may be insufficient because you can conceivably make it a moving target and lose it in your file system somewhere without your knowing.

Stanzilla commented 6 years ago

It would be really nice if you guys could do a Pull Request to correct this, you seem to already know what the issue is exactly and that would save us a lot of time :)

rodrigopsasaki commented 6 years ago

I'm having the exact same issue, running the latest version using AppImage on Manjaro