Hyper: Hyper CLI command not installed if /usr/local/bin doesn't exist

Created on 16 Apr 2018  ·  33Comments  ·  Source: vercel/hyper

Issue

I updated to 2.0.0, and the hyper commands aren't working for me. From poking around in documentation, it doesn't look like I'm supposed to do anything to have access to the CLI, but maybe I'm wrong.

bash: hyper: command not found

screen shot 2018-04-16 at 11 33 39 am

good first issue help wanted ⌨️ CLI tool Mac

Most helpful comment

I can recreate this in my OSX environment...

  1. Download and unzip Hyper
  2. Open Hyper after you download (it appears the /usr/local/bin link will link to where ever that is you first started it from - my case was the download temp directory in the browser)
  3. The link will be broken once you close that hyper instance
  4. Once you drag the app to "Applications" it will be broken also

I fixed it by the following

rm /usr/local/bin/hyper
ln -s /Applications/Hyper.app/Contents/Resources/bin/hyper /usr/local/bin/hyper
ls -lah /usr/local/bin/hyper

The last command checks it.

All 33 comments

Can you try to find this symbolic link?

❯ ls -lah /usr/local/bin/hyper
lrwxr-xr-x 1 chabou admin 52 avr 15 14:14 /usr/local/bin/hyper -> /Applications/Hyper.app/Contents/Resources/bin/hyper

I just update and I can't even see the prompt text

screen shot 2018-04-16 at 9 54 30 am

@chabou It appears /usr/local/bin/hyper doesn't exist on my machine.

@xoche I think there's a closed issue for that one: https://github.com/zeit/hyper/issues/2826
hyperborder doesn't work with 2.0.0

@colinhemphill can you verify that /usr/local/bin/ exists and if you can write inside this directory?

@chabou I created the directory after you posted your first question and tried to install Hyper from scratch. This is a brand new Mac and it definitely wasn't there initially. Maybe I need to update the permissions on /usr/local/bin and try again?

I'm having the same problem in windows 10, I upgraded hyper to version 2.0 but the CLI doesn't work.

image

image

@donatoaguirre24, you're problem on Windows might be related to this: https://github.com/zeit/hyper/issues/2823

@donatoaguirre24 please open "Edit environment variables for your account" dialog https://i.stack.imgur.com/HQPYL.png
Close it to force a refresh of env var cache from registry.

Or simply reboot your Windows.

Yeah, it turns out that /usr/local/bin was not on my new Macbook by default, so I had to create the directory and make sure it had writeable permissions. Then a fresh install of Hyper created the link, and the CLI is working for me.

After some discussion with @colinhemphill on Slack https://zeit-community.slack.com/archives/C1TMVKPFH/p1523905461000364

It appears that /usr/local/bin could not exists (and not be added to path).
Install homebrew fixed this.

We should take care of that.

Worth noting that if you do not have write access to /usr/local/bin, hyper will also fail to install.

At some point my write access got modified, running brew doctor was really helpful for anyone reaching this issue. 😄

/usr/local/bin exists on my Mac, but Hyper was not installed there. Permissions issue? Shouldn't Hyper try to install itself there by using elevated permissions?

No, /usr/local/bin is used for the reason that it does not need elevated permissions 👍

OK. Then why it's not there? 🤕

No, /usr/local/bin is used for the reason that it does not need elevated permissions +1

Unless you are trying the get it working on a machine where you don't have write permissions in /usr/local/
Wouldn't it make sense to try to symlink to $HOME/.local/bin if it fails to acess /usr/local/bin?

For some reason, on my macOS 10.13.4 installation, installing Hyper from the website didn't install hyper cli command. Checked /usr/local/bin, and it's not there.

Same issue for me. Brand new Macbook Pro. High Sierra 10.13.4 (17E202).

hyper: command not found

Hyper.app installed fine. Well, I dragged it into Applications and executed it without any errors.

Turns out /usr/local/bin didn't exist on my machine.

In my case, /usr/local/bin exists, and I still have the same issue.

@dsantosp12 for me, I think I was in the same boat. I reinstalled it and it worked. My theory is that while setting up this new computer I didn't have it originally and eventually it was added.

Got it to work. Had to install it via NPM and reboot. Dunno why it didn't install by default.

@jacksonhvisuals how did you install via npm?

Actually, I think all I ended up doing was installing hyperpower and rebooting... which shouldn't have fixed the issue, but it did. @jakobereksen

ok thank you. that did not work for me though. Even though I did install hyper through brew cask on my admin user, the install failed silently, because my default user did not have write permissions for usr/local/bin. I temporarily enabled my default user to write in that directory and the install worked. Still a weird behaviour, since all other programs I had installed before the same way did not have problems of that sort.

Sorry if bumping the thread or anything along the lines.

I installed Hyper on a brand new OSX installation -
In my case I didn't get the symbolic link on /usr/local/bin and had to create it manually using - sudo ln -s /Applications/Hyper.app/Contents/Resources/bin/hyper /usr/local/bin/hyper which fixed the problem 👍

@chabou I was thinking of helping with this issue.
I’m not familiar with MacOS installations (the whole drag to applications shazam).

After fiddling with the source I was able to find ‘app/utils/cli-install.js’ which had a part where it tried to create a symlink in ‘/usr/local/bin’ and figured it ran on installation.

I believe this is the root of the problem in cases where the symlink isn’t created (not in cases where the folder doesn’t exist, although a check could be performed there prompting the folder’s creation) - ‘/usr/local/bin’ comes with writing permissions only for Root (specifically Wheel group?) on brand new MacOS installations.

The question is whether the installation process runs on higher privileges and if not whether it should. Either way I think the default permissions on
’/usr/local/bin’ are the main problem.

Can we run the installation on higher privileges? Should we modify ‘/usr/local/bin’ write permissions?

Sorry if bumping the thread or anything along the lines.

I installed Hyper on a brand new OSX installation -
In my case I didn't get the symbolic link on /usr/local/bin and had to create it manually using - sudo ln -s /Applications/Hyper.app/Contents/Resources/bin/hyper /usr/local/bin/hyper which fixed the problem 👍

This worked for me. Thanks

I can recreate this in my OSX environment...

  1. Download and unzip Hyper
  2. Open Hyper after you download (it appears the /usr/local/bin link will link to where ever that is you first started it from - my case was the download temp directory in the browser)
  3. The link will be broken once you close that hyper instance
  4. Once you drag the app to "Applications" it will be broken also

I fixed it by the following

rm /usr/local/bin/hyper
ln -s /Applications/Hyper.app/Contents/Resources/bin/hyper /usr/local/bin/hyper
ls -lah /usr/local/bin/hyper

The last command checks it.

I can recreate this in my OSX environment...

  1. Download and unzip Hyper
  2. Open Hyper after you download (it appears the /usr/local/bin link will link to where ever that is you first started it from - my case was the download temp directory in the browser)
  3. The link will be broken once you close that hyper instance
  4. Once you drag the app to "Applications" it will be broken also

I fixed it by the following

rm /usr/local/bin/hyper
ln -s /Applications/Hyper.app/Contents/Resources/bin/hyper /usr/local/bin/hyper
ls -lah /usr/local/bin/hyper

The last command checks it.

Great, It's work for me!

Sorry if bumping the thread or anything along the lines.

I installed Hyper on a brand new OSX installation -
In my case I didn't get the symbolic link on /usr/local/bin and had to create it manually using - sudo ln -s /Applications/Hyper.app/Contents/Resources/bin/hyper /usr/local/bin/hyper which fixed the problem 👍

This worked for me as well. Thanks!

I can recreate this in my OSX environment...

  1. Download and unzip Hyper
  2. Open Hyper after you download (it appears the /usr/local/bin link will link to where ever that is you first started it from - my case was the download temp directory in the browser)
  3. The link will be broken once you close that hyper instance
  4. Once you drag the app to "Applications" it will be broken also

I fixed it by the following

rm /usr/local/bin/hyper
ln -s /Applications/Hyper.app/Contents/Resources/bin/hyper /usr/local/bin/hyper
ls -lah /usr/local/bin/hyper

The last command checks it.

Wow this works! Thanks!

I can recreate this in my OSX environment...

  1. Download and unzip Hyper
  2. Open Hyper after you download (it appears the /usr/local/bin link will link to where ever that is you first started it from - my case was the download temp directory in the browser)
  3. The link will be broken once you close that hyper instance
  4. Once you drag the app to "Applications" it will be broken also

I fixed it by the following

rm /usr/local/bin/hyper
ln -s /Applications/Hyper.app/Contents/Resources/bin/hyper /usr/local/bin/hyper
ls -lah /usr/local/bin/hyper

The last command checks it.

This is more or less exactly what I did today after installing Hyper for the first time, and it's what I came to report. Applying this fix allowed me to use Hyper but led me to this error when installing a theme: https://github.com/zeit/hyper/issues/3648#issuecomment-532355802

Installing hyper.app in macOS Mojave would fail when creating the symlink.
Uninstalling then installing via brew cask install hyper successfully created the symlink.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

LukeFlynn picture LukeFlynn  ·  47Comments

rauchg picture rauchg  ·  67Comments

timothyis picture timothyis  ·  50Comments

0x80 picture 0x80  ·  45Comments

keirlawson picture keirlawson  ·  45Comments