我在运行mix ecto.create
创建postgres DB时收到以下错误。
==> argon2_elixir
could not compile dependency :argon2_elixir, "mix compile" failed. You can recompile this dependency with "mix deps.compile argon2_elixir", update it with "mix deps.update argon2_elixir" or clean it with "mix deps.clean argon2_elixir"
==> snitch_core
** (Mix) "nmake" not found in the path. If you have set the MAKE environment variable,
please make sure it is correct.
我在apps
文件夹下的mix.exs
文件中定义如下:
# auth
{:elixir_make, "~> 0.4.2"},
{:comeonin, "~> 4.1.1"},
{:argon2_elixir, "~> 1.3.3"},
尝试按照错误消息中的建议重新编译包,但没有任何帮助。
感谢在这方面的帮助。
您似乎没有安装nmake
。我想你在Windows上吧?以某种方式安装nmake
,例如,请参阅此答案。
我终于解决了它。以下是攻击问题并解决问题的一般方法,与您的具体问题无关。
首先,我从visualstudio文件夹C:Program Files (x86)Microsoft Visual Studio2017BuildToolsVCToolsMSVC14.15.26726binHostx64x64
中复制了nmake.exe
并粘贴到System32文件夹中。运行命令mix ecto.create
并收到一个已更改的详细错误,该错误解决了问题。以下是错误的输出:** (Mix) Could not compile with "nmake" (exit status: 2).
One option is to install a recent version of
[Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools)
either manually or using [Chocolatey](https://chocolatey.org/) -
choco安装VisualCppBuildTools`。
安装Visual C++构建工具后,请查看"程序文件(x86)"目录并搜索"Microsoft Visual Studio"。记下完整路径版本号最高的文件夹的。打开"run"命令,然后键入以下命令(确保路径和版本号是正确的):
cmd /K "C:Program Files (x86)Microsoft Visual Studio 14.0VCvcvarsall.bat" amd64
这将打开一个包含必要环境变量的命令提示符设置,并且您将能够从中运行"mix-compile"、"mix-deps.compile",和"混合测试"命令
一行接一行,成功就在你的脚下