sdk: dotnet: command not found Mac OS X 10.11.4, dotnet-osx-x64.1.0.0-rc2-3002702.pkg
Steps to reproduce
- Run the latest released .NET Core
pkginstaller: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.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (2 by maintainers)
Commits related to this issue
- Adding the symlink to dotnet binary to /usr/bin This change removes adding the path through /etc/paths.d and goes to adding a symlink to /usr/bin. The reason is that there is a lot of users who are r... — committed to blackdwarf/cli by deleted user 8 years ago
- Update known-issues.md Add updated information to the known issues document about the oh-my-zsh problem and how to solve it. skip ci please Fixes #3063, #1567 — committed to dotnet/cli by deleted user 8 years ago
- Update known-issues.md (#3240) Add updated information to the known issues document about the oh-my-zsh problem and how to solve it. skip ci please Fixes #3063, #1567 — committed to dotnet/cli by deleted user 8 years ago
@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 havebrewset up and the latest openssl installed. It seems like zsh doesn’t usepath_helperby 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_helperon 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/dotnetto the PATH in .zshrc fixed the problem in my case@blackdwarf Good catch! I also found a similar offending line in my
.zshrc:At this point, it’s been so long since I set up zsh on my machine that I honestly can’t remember what’s responsible for that line in there, but oh-my-zsh is definitely a likely culprit. To resolve the issue on my end, I’ve changed the export to this:
Which then allows me to do this:
Cheers!
I ran into the same issue. I’m using oh-my-zsh. Here’s the relevant portion of my ~/.zshrc:
Manually creating the symlink to /usr/local/bin/ fixed it for me.
Thanks!