问题
Even after running "npm install -g msbot", I still see msbot : The term 'msbot' is not recognized as the name of a cmdlet, 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 when tring to clear existing secrets and decrypt use this:
msbot secret -b my.bot --secret OLDSECRET --clear
回答1:
This could be caused by a few things. Here's a few troubleshooting steps you can try:
- If your console is running inside of Visual Studio or VS Code, try running it from a normal console.
- If you just installed
msbot
, you may need to close and re-open your console. - Ensure that your
npm
folder has been added to your Environment Variables.See "Adding Environment Variables" below. - If you already have the
PATH
variable added from step 3, you may need to move that entry to ensure it is above/before your Node install path (%ProgramFiles%\nodejs\
)
Adding Environment Variable
- Start Menu > Type "environment variables" and hit Enter
- Click Environment Variables
- Double-click Path
- Ensure
C:\Users\<YourUserName>\AppData\Roaming\npm
(or your npm install path) has been added to your PATH variable. You may need to restart your computer for this to take effect.
来源:https://stackoverflow.com/questions/55007252/the-term-msbot-is-not-recognized-as-the-name-of-a-cmdlet-function-script-fil