BotFramework-Composer icon indicating copy to clipboard operation
BotFramework-Composer copied to clipboard

Error calling npm to fetch template. Full error message: Command failed with exit code

Open ArturMarins777 opened this issue 1 year ago • 4 comments

.

ArturMarins777 avatar Sep 10 '24 16:09 ArturMarins777

same Error calling npm to fetch template. Please ensure that node and npm are installed and available on your system. Full error message: Command failed with ENOENT: npm root -g --prefix

paulks-software avatar Nov 11 '24 11:11 paulks-software

Please run the following commands and report what is returned:

  • npm -v
  • node -v

Also, if you try and run the command on its own, does it work? npm install -g --prefix %userprofile%\AppData\Roaming\BotFrameworkComposer.yo-repository --loglevel error --no-optional @microsoft/generator-bot-empty@*

dmvtech avatar Dec 23 '24 20:12 dmvtech

Please run the following commands and report what is returned:

  • npm -v
  • node -v

Also, if you try and run the command on its own, does it work? npm install -g --prefix %userprofile%\AppData\Roaming\BotFrameworkComposer.yo-repository --loglevel error --no-optional @microsoft/generator-bot-empty@*

I am also having this issue. When I run the original script (https://nodejs.org/en/download/package-manager) in PowerShell (as an admin!), it returns:

v22.12.0 10.9.0

I then ran the npm command you referenced above, and it installed packages. Also notified me that npm v11.0 is available, so I ran that.

But once I close the shell and run the Bot Framework Composer, it continues to give the same error. If I then re-open PowerShell, the npm -v command returns an error that no such file is found.

MatsEReed avatar Dec 24 '24 00:12 MatsEReed

Hi all.

  • What version (if any) of Yeoman do you have installed? (yo -v)
  • Please try the nightly build of Composer https://github.com/microsoft/BotFramework-Composer-Nightlies/releases/tag/v2.1.3-nightly.364675.1a93f21

  @ArturMarins777 Are you able to run the command outside of Composer? (With the correct path)

@paulks-software

Your error does not appear to be the exact same as the original, but similar. Yours appears to possibly be a related to permissions or pathing. Can you try and run the command but with a path that you can ensure has full permissions (for example create a folder in the root of the drive and permissions for all users and then run npm install -g --prefix <CREATEDFOLDERPATH> --loglevel error --no-optional @microsoft/generator-bot-empty@*)

@MatsEReed

Did you replace %userprofile% with $env:userprofile? If you're using Powershell, the former won't work.

dmvtech avatar Dec 27 '24 19:12 dmvtech