dotnet on mac: "-bash: dotnet: command not found"
See original GitHub issueSteps 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:
- Created 7 years ago
- Comments:9 (2 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This happens because the installation package does not add the
dotnet
executable location to thePATH
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 onlyzsh
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):Thank you. Running
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin
from the page in the link you mentioned worked for me.