Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "could not compile dependency :bcrypt_elixir" error on Windows?

I'm on Windows and I am trying to install the bcrypt_elixir module.

I get the following error:

$ mix phx.server
==> bcrypt_elixir
could not compile dependency :bcrypt_elixir, "mix compile" failed. You can recompile this dependency with "mix deps.compile bcrypt_elixir", update it with "mix deps.update bcrypt_elixir" or clean it with "mix deps.clean bcrypt_elixir"
** (Mix) "nmake" not found in the path. If you have set the MAKE environment variable,
please make sure it is correct.

Here is a terminal screenshot of the error:

Error

Here is my deps function from mix.exs:

defp deps do
    [
      {:phoenix, "~> 1.3.0"},
      {:phoenix_pubsub, "~> 1.0"},
      {:phoenix_ecto, "~> 3.2"},
      {:postgrex, ">= 0.0.0"},
      {:phoenix_html, "~> 2.10"},
      {:phoenix_live_reload, "~> 1.0", only: :dev},
      {:gettext, "~> 0.11"},
      {:cowboy, "~> 1.0"},
      {:comeonin, "~> 4.0"},
      {:elixir_make, "~> 0.4.1"},
      {:bcrypt_elixir, "~> 1.0"}
    ]
  end
like image 863
William Avatar asked Mar 24 '18 23:03

William


3 Answers

I faced same problem during distillery setup with my elixir project.

Installing package resolve issue as shown below.

I found bcrypt_elixir need to install make and build-essential from Elixir Forum.

platform:- ubuntu

$ sudo apt install make

$ sudo apt-get install build-essential

like image 191
Shree Prakash Avatar answered Sep 19 '22 19:09

Shree Prakash


bcrypt_elixir uses Windows' NMake (cf. bcrypt_elixir's Makefile.win).

It seems like you don't have NMake installed.

From NMake's documentation:

NMAKE is included when you install Visual Studio or the Visual C++ command-line build tools. It's not available separately.

So you need to download Visual Studio in order to get NMake. Then you should be able to compile bcrypt_elixir.

If you already have NMake, make sure nmake.exe is located under a directory from your path.

like image 20
Ronan Boiteau Avatar answered Sep 18 '22 19:09

Ronan Boiteau


For Visual Studio 2019 (VS2019) :

cmd /K "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
like image 26
LowFieldTheory Avatar answered Sep 21 '22 19:09

LowFieldTheory