calvn/chocolatey-consul

Receiving error regarding nssm being missing

mpwaldhorst opened this issue · 1 comments

Even with nssm installed through chocolatey I receive the following error when trying to install consul:

Installing service: consul
ERROR: The term 'C:\ProgramData\chocolatey\bin\nssm.exe' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path wa
s included, verify that the path is correct and try again.
The install of consul was NOT successful.
Error while running 'C:\ProgramData\chocolatey\lib\consul\tools\chocolateyInstall.ps1'.
 See log for details.

This concerns a clean install of Windows server 2016.

Any pointers on where this issue comes from?

Try replacing:

$env:ChocolateyInstall\bin\nssm.exe

With:

Join-Path $env:ChocolateyInstall 'bin\nssm.exe' -Resolve

This will ensure binary exists as expected.