导航

You misspelled a built-in dotnet command.

Posted on 2024-06-05 13:56  杨彬Allen  阅读(258)  评论(0)    收藏  举报

现象:客户用快照提供了一个仿真环境,但是似乎dotnet某些变量丢失了,用sudo pm2 start ecosystem.js启动时提示以下信息:

 

1|medusa.e | Could not execute because the specified command or file was not found.
1|medusa.e | Possible reasons for this include:
1|medusa.e | * You misspelled a built-in dotnet command.
does not exist. You intended to execute a .NET Core program, but dotnet-/var/www/boost/medusa.engine/src/Medusa.Engine.EventEntrance.dll
1|medusa.e | * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
1|medusa.e | Could not execute because the specified command or file was not found.
1|medusa.e | Possible reasons for this include:
1|medusa.e | * You misspelled a built-in dotnet command.
does not exist. You intended to execute a .NET Core program, but dotnet-/var/www/boost/medusa.engine/src/Medusa.Engine.EventEntrance.dll
1|medusa.e | * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.
1|medusa.e | Could not execute because the specified command or file was not found.
1|medusa.e | Possible reasons for this include:
1|medusa.e | * You misspelled a built-in dotnet command.
does not exist. You intended to execute a .NET Core program, but dotnet-/var/www/boost/medusa.engine/src/Medusa.Engine.EventEntrance.dll
1|medusa.e | * You intended to run a global tool, but a dotnet-prefixed executable with this name could not be found on the PATH.

 

 

解决方案

To install the dotnet-ef tool, run the following command:

.NET 8

dotnet tool install --global dotnet-ef --version 8.*

.NET 7

dotnet tool install --global dotnet-ef --version 7.*

.NET 6

dotnet tool install --global dotnet-ef --version 6.*

.NET 5

dotnet tool install --global dotnet-ef --version 5.*

.NET Core 3

dotnet tool install --global dotnet-ef --version 3.*

 

重启服务器