dotnet: command not found Mac OS X 10.11.4, dotnet-osx-x64.1.0.0-rc2-3002702.pkg
See original GitHub issueSteps to reproduce
- Run the latest released .NET Core
pkg
installer:dotnet-osx-x64.1.0.0-rc2-3002702.pkg
. - Pull up a fresh instance of your preferred shell.
- Run
dotnet
Expected behavior
dotnet
executes and probably prints usage information because no specific command was passed.
Actual behavior
I’m given this output:
zsh: command not found: dotnet
Environment data
dotnet --info
output:
shawn ~ dotnet --info
zsh: command not found: dotnet
¯_(ツ)_/¯
normandy:~ shawn$ /usr/local/share/dotnet/dotnet --info
.NET Command Line Tools (1.0.0-preview1-002702)
Product Information:
Version: 1.0.0-preview1-002702
Commit Sha: 6cde21225e
Runtime Environment:
OS Name: Mac OS X
OS Version: 10.11
OS Platform: Darwin
RID: osx.10.11-x64
This package was found at https://go.microsoft.com/fwlink/?LinkID=798388
, and was not the link specified at the actual instruction guide at https://www.microsoft.com/net/core#macosx
.
Verifying the hash:
shawn ~ shasum ~/Downloads/dotnet-osx-x64.1.0.0-rc2-3002702.pkg -a 512
5f00fd91e1bbffe55d091c398913847bab0766ab00987d9164826a1c15f2b05eb8b56f801c0625b75161237dd31eb9180b6468b2bbd9c85077caf2fb4cae6e7a /Users/shawn/Downloads/dotnet-osx-x64.1.0.0-rc2-3002702.pkg
It’s also worth mentioning that dotnet
does, in fact, exist at /usr/local/share/dotnet/dotnet
, but there’s definitely no symlink in While there’s definitely no symlink, the more I read about this issue, the more it seems like that’s intentional. This is most likely actually a duplicate of dotnet/sdk#5193 and highlights the insufficiency of using /usr/local/bin/
.path_helper
for zsh users.
Issue Analytics
- State:
- Created 7 years ago
- Comments:16 (2 by maintainers)
Top Results From Across the Web
command not found Mac OS X 10.11.4, dotnet-osx-x64.1.0. ...
1.0.0-rc2-3002702.pkg . Pull up a fresh instance of your preferred shell. Run dotnet. Expected behavior.
Read more >dotnet: command not found in Mac
So I downloaded NET Core 2.1 SDK for mac and installed it. But when I run the dotnet command from terminal it throws...
Read more >"dotnet: command not found" after installing the Microsoft .NET ...
NET Core SDK on my MacBook, bash returned "dotnet: command not found" until another symbolic link was created.
Read more >Install .NET on macOS
In this article, you'll learn how to install .NET on macOS. .NET is made up of the runtime and the SDK. The runtime...
Read more >Troubleshoot .NET tool usage issues
Could not execute because the specified command or file was not found. Possible reasons for this include: * You misspelled a built-in dotnet...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top 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
@wenjiangtao The quick fix is to just run
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
, which will get you a workingdotnet
, but doesn’t change the fact that adding the entry for dotnet in/etc/paths.d/
doesn’t seem to work well for zsh users.@dasMulli I haven’t made any symlinks to the dotnet binary before, and there was nothing referencing it in
/usr/local/bin/
at that point.Also, in reference to that issue, I think the more sensible option would be to just create a symlink in
/usr/local/bin/
- it’s very likely to already be part of a user’s PATH since the project requires you to havebrew
set up and the latest openssl installed. It seems like zsh doesn’t usepath_helper
by default, or at least, not in the way that the dotnet maintainers expect it to.@flyingsky I’m not sure if the installer actually added a symlink to
/usr/local/bin/
or if zsh actually runspath_helper
on your system, but I was definitely not able to run dotnet after opening a new shell or a new instance of zsh. Or maybe I shouldn’t assume you’re a zsh user, haha.Adding
/usr/local/share/dotnet
to the PATH in .zshrc fixed the problem in my case