question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dotnet on mac: "-bash: dotnet: command not found"

See original GitHub issue

Steps to reproduce

I have Sierra version of OSX on which I tried following the installation instructions a few times. This is what I get:

 ▷  brew install openssl
Warning: openssl-1.0.2j already installed

 ▷  ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln: /usr/local/lib//libcrypto.1.0.0.dylib: File exists

 ▷  ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
ln: /usr/local/lib//libssl.1.0.0.dylib: File exists

When I use the installer (dotnet-dev-osx-x64.1.0.0-preview2-003131.pkg), it works fine

The path /usr/local/share/dotnet does exist

Expected behavior

When I run “dotnet” command, I expect it to work

Actual behavior

Command dotnet does not work. The terminal says -bash: dotnet: command not found

Environment data

None

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

42reactions
pealmeidcommented, Oct 10, 2016

This happens because the installation package does not add the dotnet executable location to the PATH environment variable. This issue is mentioned in https://github.com/dotnet/core/blob/master/cli/known-issues.md#users-of-zsh-z-shell-dont-get-dotnet-on-the-path-after-install, but apparently it does not affect only zsh users. You need to add this path manually.

In my case the path was /usr/local/share/dotnet, so I ran (from the command line):

export PATH=/usr/local/share/dotnet:$PATH
16reactions
explorer2309commented, Oct 10, 2016

Thank you. Running ln -s /usr/local/share/dotnet/dotnet /usr/local/bin from the page in the link you mentioned worked for me.

Read more comments on GitHub >

github_iconTop Results From Across the Web

dotnet: command not found in Mac
Run sudo ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/ in the command line, you then should be prompted for your password. This is the ...
Read more >
zsh: command not found: dotnet on Mac m1 · Issue #22910
I have macOS 12.0.1 When I open a project on visual studios, the message says that I need to install .net core 3.1....
Read more >
Install .NET on macOS
Edit the appropriate source file for your shell and add :$HOME/dotnet to the end of the existing PATH statement. If no PATH statement...
Read more >
I can't figure out how to get dotnet running on my mac
Fire up a terminal, run the bash command to start a new Bash session, and then run the rest of the commands. Finally,...
Read more >
"dotnet" is not recognized - Microsoft Q&A
After it is installed then try the dotnet command. If it says it doesn't exist then it wasn't added to the path or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found