0

Unable to install npm botskills command on Self-Hosted Azure agent.

Used following command to install packages get updated but when tried to check using "botskills" command it throws up and error saying botskills not available.

Screenshots

Used " npm install -g botskills@latest " to install the package where the following screenshot infers that the botskill packages have been updated.

image

But when tried to use the updated package it does not work

image

All the other supporting packages have been updated.

This issue occurs while using the Self-Hosted agent (Windows agent) only and works with no issue on local.

Steps to reproduce 1) Use any of the Microsoft Self-Hosted Agent. 2) Try installing botkskills using following command npm install -g botskills@latest (Follow the attached screenshots) 3) Try using botskills to verify if the package is available.

  • Hi @Priyanka Shetty Did you checkout below answer, and add the botskills package installation path to Environment PATH? How did it go? – Levi Lu-MSFT Mar 01 '20 at 14:35

2 Answers2

0

I'm not sure if it is supported on a Azure agent, but this looks like a pathing issue.

On a typical machine, in powershell you can run the following to check what your path variable is set to:

$env:path.split(";")

You should typically have something like: C:\Users\<username>\AppData\Roaming\npm as one of the paths.

For me, bot skills is at: C:\Users\<myusername>\AppData\Roaming\npm\botskills.ps1

If you don't have that npm path in your path variable, that needs to be remedied somehow. If it's there, then you need to verify that botskills.ps1 is there.

When everything is setup correctly, you can use the following in PowerShell to find the path:

get-command botskills | select path

Dana V
  • 1,327
  • 1
  • 5
  • 10
0

The error botskills not recognized is because the botskills package installation path is not in the System Environment variables PATH of you local machine. Azure pipeline agent is running as a different user (by default the NetworkService user), and the botskills package is installed by azure pipeline in a different path that unknown to system environment path.

You need to manually add the "path" to the system environment Path for the self-hosted agent machine.

You can also use --prefix to specify a custom npm package installation folder, and make sure add the path to system environment path for the self-hosted agent machine.

npm install botskills@latest -g --prefix C:\custompath\npm

Or you can add the installation path to Environment path in the powershell task using below script.

$env:Path += ";C:\path to botskills installation\npm"

Please check the answer to this thread for more information and the discussion for a similar issue here.

Levi Lu-MSFT
  • 27,483
  • 2
  • 31
  • 43