简体   繁体   中英

argon2 elixir compilation issue while mix ecto.create

I am getting the below error while running mix ecto.create to create the 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.

I am defining it in the mix.exs file under apps folder as below:

  # auth
  {:elixir_make, "~> 0.4.2"},
  {:comeonin, "~> 4.1.1"},
  {:argon2_elixir, "~> 1.3.3"},

Tried to recompile the package as suggested in the error message but nothing helped.

Appreciate help in this regard.

It appears that you don't have nmake installed. You're on Windows I presume? Install nmake one way or another, see for example this answer .

I was able to solve it finally. Here is the general approach to attack the problem and solve it, irrespective of your specific issues.

First, I copied the nmake.exe from the visual studio folder C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\Hostx64\\x64\\ and pasted in System32 folder. Ran the command mix ecto.create and received a changed elaborate error which solved the issue. Here is the output of the error: ** (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/) - ** (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 install VisualCppBuildTools`.

After installing Visual C++ Build Tools, look in the "Program Files (x86)" directory and search for "Microsoft Visual Studio". Note down the full path of the folder with the highest version number. Open the "run" command and type in the following command (make sure that the path and version number are correct):

cmd /K "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

This should open up a command prompt with the necessary environment variables set, and from which you will be able to run the "mix compile", "mix deps.compile", and "mix test" commands.`

Follow this line by line, and success is at your feet. :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM