getting-started icon indicating copy to clipboard operation
getting-started copied to clipboard

Token not found/unknown service

Open corporal-clegg87 opened this issue 4 years ago • 5 comments

After following the guide to run wechaty for the first time in linux and windows, I was not successful. There are a few issues:

  • Which token provider to use is not clear. Some links are circular, others are dead ends.
  • Incorrect method for setting environment variables in windows ("set" should be "$env:" for powershell. powershell is was required for some steps. I cannot remember which)
  • Step: "npm install wechaty-puppet-NAME" missing

These are the steps I took to install wechat on windows today:

Windows installation instructions

  1. Use powershell in administrator mode.
  2. Install node.js v12+
  3. Clone repo: git clone https://github.com/wechaty/wechaty-getting-started.git cd wechaty-getting-started
  4. npm install
  5. Install token service npm install wechaty-puppet-NAME (padlocal confirmed working)
  6. Get token from token service provider
  7. Set environment variables: $env:WECHATY_PUPPET="wechaty-puppet-NAME" $env:WECHATY_PUPPET_NAME_TOKEN="TOKEN" $env:WECHATY_LOG="verbose"
  8. npm start

corporal-clegg87 avatar Apr 10 '21 07:04 corporal-clegg87

Now the next problem is that I have already paid for a token from paimon. When I try to set paimon as the puppet via $env:WECHATY_PUPPET="wechaty-puppet-paimon" I get npm module not supported. This is the same error which was fixed for padmon by running npm install wechaty-puppet-padmon . Running the npm install wechaty-puppet-paimon yields NOT FOUND

corporal-clegg87 avatar Apr 10 '21 07:04 corporal-clegg87

There's no such puppet named wechaty-puppet-paimon because the paimon is a Puppet Service instead of a Puppet Provider.

Please try the following command if you are using the paimon puppet service:

export WECHATY_PUPPET=wechaty-puppet-service
export WECHATY_PUPPET_SERVICE_TOKEN=puppet_paimon_XXX

Then I believe your Wechaty bot will be able to start with the paimon service.

huan avatar Apr 10 '21 17:04 huan

Hello, after re-read your issue, I believe that our docs should be improved and you know how to make it work under Windows/PowerShell.

It would be great if you can send PRs to fix what you found is not right in our docs, thank you very much!

huan avatar Apr 21 '21 12:04 huan

sorry, i just saw this response now and don't remember exactly what I was working with back then. i will have a look over the coming days.

corporal-clegg87 avatar May 20 '21 12:05 corporal-clegg87

Great to hear from you, thank you very much!

huan avatar May 22 '21 06:05 huan