Trouble Installing Nextstrain CLI


I have a Windows computer and was following the instructions here: Installing Nextstrain — Nextstrain documentation. However, I am receiving the attached error. It seems like it has to do with a space in my folder name, but I can’t change the name (set up by my job) and, when I’ve tried to reset the directory, it keeps trying to get to this folder… Can you help?

Hi @mtcaton,

It looks like you have two commands in the same line:

cd "C:\Users\Mikala Caton\" Invoke-RestMethod | Invoke-Expression

They should be entered separately:

cd "C:\Users\Mikala Caton\"
Invoke-RestMethod | Invoke-Expression

The first command isn’t required for Nextstrain installation, so try running the command starting with Invoke-RestMethod and let us know if that doesn’t work.

– Victor

Unfortunately, I got the same error when I ran them separately.

@mtcaton can you post a screenshot of the error from running them separately?

I don’t have a Windows computer on hand to verify, but the error from the screenshot above looks to be because cd is having trouble understanding what Invoke-RestMethod is. I wouldn’t expect the same error message if they are run separately.

hmm yes, I see what you’re saying. Here is the error when I have run them separately.

That makes more sense. You’re right, this is happening because of the space in your folder name. I’ve opened an issue in our GitHub repository and we will look into fixing it.

1 Like


I have implemented a fix for this issue. It is not officially released yet, but in the meantime you can try this command which should work:

Invoke-RestMethod | Invoke-Expression
1 Like

It worked! Thank you so much!

1 Like