Can't Install on Mac Big Sur

I am trying to install Mongoose OS (I’m a complete newbie to Mongoose). I’ve followed the instructions here, but I get “Permission denied” when creating directories:

georgeboydratcliff@MacBook ~ % curl -fsSL https://mongoose-os.com/downloads/mos/install.sh | /bin/bash mos
Installing libftdi1.2.dylib ...
mkdir: /usr/local/opt/libftdi/lib: Permission denied
curl: (23) Failed writing body (0 != 16096)
Installing libusb-1.0.0.dylib ...
mkdir: /usr/local/opt/libusb/lib: Permission denied
curl: (23) Failed writing body (0 != 16094)
Downloading https://mongoose-os.com/downloads/mos-release/mac/mos ...
######################################################################## 100.0%
Installing into /Users/georgeboydratcliff/.mos/bin/mos ...
Adding /Users/georgeboydratcliff/.mos/bin to your PATH in /Users/georgeboydratcliff/.profile
dyld: Library not loaded: /usr/local/opt/libftdi/lib/libftdi1.2.dylib
Referenced from: /Users/georgeboydratcliff/.mos/bin/mos
Reason: image not found
/bin/bash: line 69: 66932 Abort trap: 6 $FULLPATH version
SUCCESS: /Users/georgeboydratcliff/.mos/bin/mos is installed.
Run '/Users/georgeboydratcliff/.mos/bin/mos --help' to see all available commands.
Run '/Users/georgeboydratcliff/.mos/bin/mos' without arguments to start a simplified Web UI installer.
zsh: command not found: mos
georgeboydratcliff@MacBook ~ %

I’ve tried running under sudo too, but same errors.
Any ideas? I’ve come from Arduino IDE and PlatformIO, and really want to try Mongoose!
Thanks in advance
George

Try to install it with brew:

brew tap cesanta/mos
brew install mos

Thanks nliviu. Tried that and get different errors (‘brew tap cesanta/mos’ worked, but ‘brew install mos’ gives me “Error: No similarly named formulae found.”) I’ve verified brew with brew -v and it appears to be installed correctly.

Strange.
Let’s try something else.

brew untap cesanta/mos
brew install libftdi libusb libusb-compat
mos version

‘brew untap cesanta/mos’ worked fine, but ‘brew install libftdi libusb libusb-compat’ failed with the error: georgeboydratcliff@MacBook ~ % brew install libftdi libusb libusb-compat
==> Searching for similarly named formulae…
Error: No similarly named formulae found.
Error: No available formula or cask with the name “libftdi”.
==> Searching for a previously deleted formula (in the last month)…
Error: No previously deleted formula found.
==> Searching taps on GitHub…
Error: No formulae found in taps.
georgeboydratcliff@MacBook ~ %

‘mos version’ is in my path, but gives me ‘zsh: command not found: mos’

Suddenly Arduino’s IDE isn’t looking so bad :slight_smile:

Strange, both methods should work.
What architecture is your computer? Intel or M1?

1.2GHz Quad-Core Intel Core i7
macOS Big Sur (Version 11.1)

For what it’s worth, I’m also running Big Sur but it all works fine here. I wish I could offer a suggestion.

I ran into this same issue today, same exact terminal output that you list above, while trying to install MOS using curl on my new MacBook Pro (BigSur 11.6). This output that you listed:

mkdir: /usr/local/opt/libftdi/lib: Permission denied
curl: (23) Failed writing body (0 != 16096)
Installing libusb-1.0.0.dylib ...
mkdir: /usr/local/opt/libusb/lib: Permission denied
curl: (23) Failed writing body (0 != 16094)

was caused by the directory opt in the path /usr/local/opt not being present. The permissions on the directory local are read&write for the system only so the mkdir fails and the opt is not created. Interestingly, by installing brew as @nliviu suggested above, that process creates these directories using sudo in the script. From the brew install:

==> /usr/bin/sudo /bin/mkdir -p /usr/local/bin /usr/local/etc /usr/local/include /usr/local/sbin /usr/local/var /usr/local/opt /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Frameworks

or you could

/usr/bin/sudo /bin/mkdir -p /usr/local/opt

Note the mkdir -p is to create the parent directories if needed. Then running the curl script after as you listed, allows the script to complete. I wish I could say that solves the problem, however there is a remaining issue with the library libusb-1.0.0.dylib.

jimwoolaway@Jims-MBP ~ % mos             
dyld: Library not loaded: /usr/local/opt/libusb/lib/libusb-1.0.0.dylib
  Referenced from: /usr/local/bin/mos
  Reason: Incompatible library version: mos requires version 4.0.0 or later, but libusb-1.0.0.dylib provides version 2.0.0
zsh: abort      mos

I have also tried to install MOS using Brew on BigSur which also fails to run for the same issue.

jimwoolaway@Jims-MBP ~ % brew install mos
Warning: cesanta/mos/mos 2.19.1 is already installed and up-to-date.
To reinstall 2.19.1, run:
  brew reinstall mos
jimwoolaway@Jims-MBP ~ % mos
dyld: Library not loaded: /usr/local/opt/libusb/lib/libusb-1.0.0.dylib
  Referenced from: /usr/local/bin/mos
  Reason: Incompatible library version: mos requires version 4.0.0 or later, but libusb-1.0.0.dylib provides version 2.0.0
zsh: abort      mos

I see from brew doctor:

Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
  libftdi
  libusb

running the brew link:

jimwoolaway@Jims-MBP ~ % brew link libftdi
Linking /usr/local/Cellar/libftdi/1.5_2... Error: Directory not empty @ dir_s_rmdir - /usr/local/opt/libftdi
jimwoolaway@Jims-MBP ~ % brew link libusb 
Linking /usr/local/Cellar/libusb/1.0.24... Error: Directory not empty @ dir_s_rmdir - /usr/local/opt/libusb

Delete the Libraries folders /usr/local/opt/libusb and /usr/local/opt/libftdi. Then run the link again:

jimwoolaway@Jims-MBP opt % brew link libusb     
Linking /usr/local/Cellar/libusb/1.0.24... 6 symlinks created.
jimwoolaway@Jims-MBP opt % brew link libftdi    
Linking /usr/local/Cellar/libftdi/1.5_2... 16 symlinks created.
jimwoolaway@Jims-MBP opt % mos
First run of the version 2.19.1, initializing...
Init done.

The MOS can be difficult to install on the Mac but it is worth the effort.