我在mac上安装了dotnet core,但是没有找到“dotnet"命令 [英] I've installed dot net core on mac, but didn't find "dotnet" command
问题描述
今天我刚刚下载并安装了dotnet-dev-osx-x64.1.0.0-preview1-002702.pkg".之后我在终端中尝试了dotnet"命令,没有打印出来.
Today I've just downloaded "dotnet-dev-osx-x64.1.0.0-preview1-002702.pkg" and installed it. After that I tried "dotnet" command in my terminal, nothing printed.
我也尝试过 Spotlight 搜索,似乎没有找到.
I also tried Spotlight searching, seems nothing found.
这个包安装在哪里?
推荐答案
关键是你需要找到文件 dotnet.exe,然后创建一个新的符号链接来创建一个指向该 dotnet.exe 文件的新快捷方式链接usr/local/bin 文件夹.有时您会看到此错误/usr/local/bin//dotnet: File exists",这意味着该链接已存在于该文件夹中(通常是错误的),要修复您需要转到该文件夹并删除链接.
The key thing is you need to locate the file dotnet.exe, then create a new Symbolic link to create a new shortcut link to that dotnet.exe file in the usr/local/bin folder. Sometimes you see this error "/usr/local/bin//dotnet: File exists", it means the link already exists in that folder (and it's normally a faulty one), to fix that you need to go to that folder and delete the link.
找到 dotnet.exe 文件后,在我的情况下,它位于/usr/local/share/dotnet/dotnet"文件夹中.使用以下命令为其创建一个新的符号链接:
After you have located the dotnet.exe file, in my case it's in the '/usr/local/share/dotnet/dotnet' folder. Create a new symbolic link for it using this command:
ln -s/usr/local/share/dotnet/dotnet/usr/local/bin/
ln -s /usr/local/share/dotnet/dotnet /usr/local/bin/
完成!您现在可以运行dotnet"命令...希望对您有所帮助
Done! You can run the "dotnet" command now...Hope it helps
这篇关于我在mac上安装了dotnet core,但是没有找到“dotnet"命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!