Hey @TimR , are you still experiencing this issue?
@product_experience Yes, still having this issue. Any ideas for me?
Both the npm and bin folders should have been created for you by default. When you install node, it should be bundled with npm already, so it should create the %APPDATA%\npm folder by default. When you install @qualtrics/solution-cli, it should create (if not already there) an %APPDATA\npm\bin folder which is NOT added to %PATH% by default (I know you added this to %PATH% already). Dumb question, but you’ve closed and re-opened your PS terminal since changing the PATH right? $Env:Path includes your \bin folder right?
You basically need to find where solution-cli was installed. If you find it and navigate to the folder within PS, can you run the solution.exe command? If that works, and $Env:Path shows the folder where the solution.exe executable is, there’s no reason this wouldn’t work.
@qHubert When I did my first cleanup for a fresh install, I believe I deleted the npm folder in my %APPDATA\Roaming folder. After reinstalling nvm and having it install the latest node, then installing xmt-cli followed by solution-cli, there was no npm folder, so I manually recreated the npm folder with the following path:
%APPDATA\Roaming\npm\bin
Is it correct to be in \Roaming\, or should it be in \Local\?
Yes, I have closed and re-opened my PS terminal since changing the PATH.
Yes, $Env:Path includes %APPDATA\Roaming\npm (which wasn’t working, so I also tried to use %APPDATA\Roaming\npm\bin).
I found two different location types where there was a solution-cli folder...
- Within each of my Qualtrics plugin directories (e.g. %USER%\...\plugins\...\node_modules\@qualtrics\solution-cli)
- At %APPDATA\Roaming\nvm\v20.9.0\node_modules\@qualtrics\solution-cli
...but none of those solution-cli folders contained solution.exe.
The only place I found solution.exe was in %APPDATA\Roaming\nvm\v20.9.0\bin. I navigated to that directory in PowerShell, and when I attempted to run just “solution”, I received the same error as my original post:
solution : The term 'solution' is not recognized as the name of a cmdlter, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At lin:1 char:1
+ solution init
+ ~~~~~~~~
+ CategoryInfo : ObjectNotFound: (solution:String) :], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
However, I received a suggestion:
Suggestion g3,General]: The command solution was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\solution". See "get-help about_Command_Precedence" for more details.
I followed the suggestion and typed in “.\solution”, and it was successful. I just tested, and tried the command “.\solution init” and was finally prompted to log in (the step I’ve been trying to get to this whole time).
Is this just how I need to operate - with “.\” before my solution commands - or is this indicative that there’s something wrong in my environment variables path (i.e. instead of %APPDATA\Roaming\npm I should use %APPDATA\Roaming\nvm)? Also, is there anything wrong with the install of solution-cli given where I’ve indicated solution.exe was found?
Sorry, correction on my last - I first had the Environment Variables Path set to include %APPDATA\Roaming\npm\bin (per the Developer Portal documentation), but I had swapped it to just %APPDATA\Roaming\npm as part of my troubleshooting. Guess I flipped it back with my testing today, but I can verify that neither of them work.
I’ve got another question stemming from the Developer Portal documentation. It has that note for Windows users saying to use the AppData\Roaming\npm\bin path, but I don’t know if that’s correct if someone is using a Node Version Manager, as there seems to be nothing installed in that location. My User and System Variables both have a path for %NVM_HOME% and %NVM_SYMLINK%. Should those be covering what seems to be the actual path of %APPDATA\Roaming\nvm\v20.9.0\bin?
This might highlight the issue I had this whole time. The Developer Portal documentation worked for me the first time when I simply installed node by myself (WITHOUT use of a node version manager). The PATH for Environment Variables was correct, hence why I successfully got through the solution init step and submitted my first extension. THEN, when I started fresh with a node version manager (nvm), where the install of node rests NOT in the npm folder but in the nvm folder, the instructions might be wrong. I’m not positive, as I’m unexperienced in this realm, but those are the pieces that fit together while mulling this over. If that is correct, then the documentation should probably include different instructions for Windows users with just node and Windows users with a node version manager - PATHS might not be the same.
I don’t know what the nvm PATH ought to be, though, if that’s the case, because I’m seeing a versioned folder inside %APPDATE\roaming\nvm (i.e. “v20.9.0\bin” as of right now), so if we were to use that, I’d have to update my environment variable PATH any time I update node, wouldn’t I? As mentioned before, do the %NVM_HOME% and %NVM_SYMLINK% take effect here? If they did, I’d imagine I wouldn’t have run into the problem I had, so I’m guessing they don’t serve that purpose, but I don’t know.
Either way, should I be seeing the solution.exe in a different directory than where I find my solution-cli folder?
- %APPDATA\Roaming\nvm\v20.9.0\node_modules\@qualtrics\solution-cli\
- %APPDATA\Roaming\nvm\v20.9.0\bin\solution.exe
Well, I just proved at least one idea right - set my Environment Variables PATH to include C:\Users\<username>\AppData\Roaming\nvm\<current node version>\bin
So mine looked like C:\Users\<username>\AppData\Roaming\nvm\v20.9.0\bin. Added it to the Path, restarted PowerShell, navigated to my plugin directory, ran npm install and npm install --location=global @qualtrics/solution-cli, then ran solution init and was prompted to log in! I might have figured it out. This leads me to the unpleasant conclusion, though, that I’ll have to update the Environment Variables each time node updates. I tried a generic Path of C:\Users\<username>\AppData\Roaming\nvm already to no avail, so I probably just learned something others already know about how specific paths need to be, which becomes difficult with nvms and changing versions.