core icon indicating copy to clipboard operation
core copied to clipboard

~$ dotnet command not found issue

Open domsanders4 opened this issue 6 years ago • 6 comments

Problem encountered on https://dotnet.microsoft.com/learn/aspnet/hello-world-tutorial/install Operating System: macos

Provide details about the problem you are experiencing. Include your operating system version, exact error message, code sample, and anything else that is relevant.

after downloading .NET SDK I attempted to run it in a new Terminal window. The following showed after attempting to run the command ~$ dotnet " zsh: command not found: ~$ "

Any help would be greatly appreciated

domsanders4 avatar Jan 21 '20 16:01 domsanders4

It sounds like you're typing ~$ into your terminal. You aren't meant to do that, just run dotnet. 🙂

~$ is just shorthand for the prompt you should see in your actual terminal. You can also use the Copy button or select the text and see that ~$ isn't included.

dagood avatar Jan 21 '20 21:01 dagood

@dagood with running just dotnet if it is not recognized I assume it wasn't installed correctly?

domsanders4 avatar Jan 21 '20 21:01 domsanders4

It's possible you're also running into this issue, then: https://github.com/dotnet/core-setup/issues/6521

dagood avatar Jan 21 '20 21:01 dagood

I'm running Ubuntu 18.04.2. I receive the error message "Command 'dotnet' not found, but can be installed with: sudo snap install dotnet-sdk"

I run "sudo snap install dotnet-sdk" successfully. I restart the server I then run "dotnet web" and it fails with the same message.

I run "whereis dotnet". I get the message: "dotnet: /usr/local/bin/dotnet" I run "sudo ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/" and receive the error message: "ln: failed to create symbolic link '/usr/local/bin/dotnet': File exists"

Have no idea how to fix this. need help.

SlkRck avatar Jan 22 '20 06:01 SlkRck

Ubuntu 18.04 doesn't work the same as macOS--this is not directly related.

'/usr/local/bin/dotnet': File exists

That suggests that you do have .NET Core installed correctly, but your PATH environment variable is incorrectly configured. If you run echo $PATH, you should see a string that contains /usr/local/bin.

If your PATH variable doesn't have /usr/local/bin, one potential reason for this is bad shell configuration. (.bash_profile, .bashrc, .profile, etc.) Look at this script and make sure PATH isn't cleared out. For example, PATH=/home/user/foo clears it out, PATH=$PATH:/home/user/foo appends to it and is ok.

Please file a new issue if you need more help, since it's a unique situation.

dagood avatar Jan 22 '20 23:01 dagood

Closing due to lack of activity; please reopen if you still need help.

scalablecory avatar Jan 30 '20 20:01 scalablecory