When I install the module “bcrypt_elixir” 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"
==> appx
** (Mix) "nmake" not found in the path. If you have set the MAKE environment variable,
please make sure it is correct.
Basically what NobbZ said, you need a C compiler installed. The bcrypt docs
point you to the comeonin wiki for details (see the Requirements wiki page).
If you get the Visual Studio tools and launch a cmd shell with the right bat file that sets paths, you can properly build things like comeonin and bcrypt. It’s a stupid pain, but with some fiddling it works.
You can use chocolatey to install the Visual Studio build tools, or you can just install them yourself from MS downloads. But the critical step is start a cmd shell running the appropriate script so you get nmake in your path.
cmd /K ‘C:\Program Files (x86)\Microsoft Visual C++ Build Tools\vcbuildtools.bat’
I had this working previously where I could use PowerShell, but it mysteriously broke and now I’m stuck with CMD.exe. Whatever, it’s Windows, so the fact that you can actually build is a miracle.
Here’s what I have working now. I have a file called wcmd.cmd that I run which sets up the paths and stuff for the VC tools and launches a PowerShell as administrator.
I used to be able to just double click and run that and end up with a PowerShell that would successfully mix compile, but for some reason that stopped working. Now I have to launch a PowerShell as admin, then go type
.\wcmd.cmd
and hit return. That will run the script and launch a PowerShell with nmake visible. That’s the shell you use to develop in.