Trying to add bcrypt_elixir but am getting the error ** (Mix) “nmake” not found in the path

I want to l add :bcrypt_elixir as a dependency in my mix project. But I’m getting the error ** (Mix) “nmake” not found in the path. If you have set the MAKE environment variable, please make sure it is correct.

Check step 2: Bcrypt — bcrypt_elixir v3.3.2

1 Like

Thanks, i’ve followed the step 2 and installed the visual studio c++ build tools. Do note i’m using vs code tho and not visual studio ide. So using the developer terminal for visual studio, i cd into my project directory and ran mix compile and mix deps.compile. Although it seems to have worked, my project now builds without showing the error during compilation, but for some reason, the defmodule is still highlighted with red and showing the no nmake in path make sure you set the correct path error. I feel theres one more step i need to take that i’m missing, maybe setting an environment variable or something like that in the vs code project itself, not sure.

Update: Actually isn’t working still. Getting an error 11:14:27.657 [error] Process #PID<0.269.0> raised an exception
** (RuntimeError) An error occurred when loading Bcrypt.
Make sure you have a C compiler and Erlang 20 installed.
If you are not using Erlang 20, either upgrade to Erlang 20 or
use version 0.12 of bcrypt_elixir.
See the Comeonin wiki for more information.

Note: Steps i followed: I downloaded visual studio c++ build tools. Which gave me access to a developer command prompt. in the command prompt i also tried going to my project folder and running iex and trying to use the Bcrypt.hash_pwd_salt fucntion, and i still got the error

Yeah you need to start vscode in a way where nmake is available. The easiest way is starting vscode from the terminal, where you know nmake is available.

1 Like

Please how do i do this

If its by just typing code . from the developer terminal in my project directory, then i just tried that but is still getting an error saying make sure you have a c compiler.

You have to start the command prompt specifically setup for Visual Studio - it should be buried in available applications somewhere (it’s been a couple of years since I was on Windows last). You will see the normal command prompt, the admin one and at least one Visual Studio one. Run mix compile etc from there. Google ‘running Visual Studio command line nmake’ or similar if all else fails.