The term ‘gulp’ is not recognized as the name of a cmdlet error

Question:

So I am trying to run gulp on our build server but keep getting the error above. Everything works fine if I log into the build server with my user account as I installed gulp globally under my account however when Jenkins runs my powershell script it fails with the error:

The term ‘gulp’ is not recognized as the name of a cmdlet error

So I tried to install globally in my script so that it installs with whatever user Jenkins uses.

Then I added npm -g ls to The powershell script and found that it is installed globally under a system user:

C:\Windows\system32\config\systemprofile\AppData\Roaming\npm >
gulp@3.9.0

Since I am still getting the error I took the advice from this post and added a path variable with the directory above however still the same error.

Anyone have ideas on what I can try next? Im stumped as to why it is not working.

Answer:

Make sure the directory containing gulp.exe is contained in the $env:PATH environment variable. You can update the machine-wide PATH variable with the [Environment]::SetEnvironmentVariable() method.

Let’s imagine the path to the gulp executable is C:\Program Files\gulp\bin\gulp.exe

Source:

The term ‘gulp’ is not recognized as the name of a cmdlet error by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply