Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keep getting "can not found bot file: src/main.ts" #937

Closed
xinbenlv opened this issue Oct 30, 2017 · 4 comments
Closed

Keep getting "can not found bot file: src/main.ts" #937

xinbenlv opened this issue Oct 30, 2017 · 4 comments

Comments

@xinbenlv
Copy link
Contributor

$ ▶npm start
> haoshiyou-bot@1.0.1 start /usr/local/google/home/zzn/ws/haoshiyou-bot
> docker run --env CLOUDINARY_SECRET=$CLOUDINARY_SECRET -ti --volume="$(pwd)":/bot --rm zixia/wechaty src/main.ts


 __        __        _           _          
 \ \      / /__  ___| |__   __ _| |_ _   _  
  \ \ /\ / / _ \/ __| '_ \ / _` | __| | | | 
   \ V  V /  __/ (__| | | | (_| | |_| |_| | 
    \_/\_/ \___|\___|_| |_|\__,_|\__|\__, | 
                                     |___/  
____________________________________________________
            https://www.chatie.io
  ____                            _   _             
 / ___|___  _ __  _ __   ___  ___| |_(_)_ __   __ _ 
| |   / _ \| '_ \| '_ \ / _ \/ __| __| | '_ \ / _` |
| |__| (_) | | | | | | |  __/ (__| |_| | | | | (_| |
 \____\___/|_| |_|_| |_|\___|\___|\__|_|_| |_|\__, |
                                              |___/ 
  ____ _           _   ____        _       
 / ___| |__   __ _| |_| __ )  ___ | |_ ___ 
| |   | '_ \ / _` | __|  _ \ / _ \| __/ __|
| |___| | | | (_| | |_| |_) | (_) | |_\__ \
 \____|_| |_|\__,_|\__|____/ \___/ \__|___/
                                           

Starting Wechaty v0.10.44 with Node.js v7.10.1 ... ## (zzn): Note the version here is very weird
ERROR: can not found bot file: src/main.ts
  _____                _     _           _                 _   _              
 |_   _| __ ___  _   _| |__ | | ___  ___| |__   ___   ___ | |_(_)_ __   __ _  
   | || '__/ _ \| | | | '_ \| |/ _ \/ __| '_ \ / _ \ / _ \| __| | '_ \ / _` | 
   | || | | (_) | |_| | |_) | |  __/\__ \ | | | (_) | (_) | |_| | | | | (_| | 
   |_||_|  \___/ \__,_|_.__/|_|\___||___/_| |_|\___/ \___/ \__|_|_| |_|\__, | 
                                                                       |___/  

    Troubleshooting:

    1. Did you bind the current directory into container?

      check your `docker run ...` command, if there's no `volumn` arg,
      then you need to add it so that we can bind the volume of /bot:

        `--volume="$(pwd)":/bot`

      this will let the container visit your current directory.

    if you still have issue, please have a look at
      https://github.com/chatie/wechaty/issues/66
      and do a search in issues, that might be help.


 __        __        _           _          
 \ \      / /__  ___| |__   __ _| |_ _   _  
  \ \ /\ / / _ \/ __| '_ \ / _` | __| | | | 
   \ V  V /  __/ (__| | | | (_| | |_| |_| | 
    \_/\_/ \___|\___|_| |_|\__,_|\__|\__, | 
                                     |___/  
____________________________________________________
            https://www.chatie.io
  _____      _ _     _  
 | ____|_  _(_) |_  / | 
 |  _| \ \/ / | __| | | 
 | |___ >  <| | |_  | | 
 |_____/_/\_\_|\__| |_| 
                        
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! haoshiyou-bot@1.0.1 start: `docker run --env CLOUDINARY_SECRET=$CLOUDINARY_SECRET -ti --volume="$(pwd)":/bot --rm zixia/wechaty src/main.ts`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the haoshiyou-bot@1.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /usr/local/google/home/zzn/.npm/_logs/2017-10-30T05_50_07_946Z-debug.log
@xinbenlv
Copy link
Contributor Author

After docker pull zixia/wechaty, I had a new version of image, and the same error is there, while

Starting Wechaty v0.10.44 with Node.js v7.10.1

is now

Starting Wechaty v0.11.42 with Node.js v8.8.1 ...

@huan
Copy link
Member

huan commented Oct 30, 2017

I do not know what happened but I suggest you try to run unit tests inside docker and have a look at it.

like: wechaty test

See: https://circleci.com/gh/Chatie/wechaty/2698

@huan
Copy link
Member

huan commented Oct 30, 2017

I tried the latest docker image and it works without any problem.

What I did is:

$ docker pull zixia/wechaty
Using default tag: latest
latest: Pulling from zixia/wechaty
d26cfb4142fa: Already exists
64e695836438: Already exists
23612a50167e: Already exists
0f87853aa05b: Already exists
196b8aba5fb6: Already exists
3ab76d76d517: Pull complete
da68d8d87082: Pull complete
5798875f6a38: Pull complete
4370c26e3122: Pull complete
b62a68d53d44: Pull complete
f2569eb83597: Pull complete
fc0b437f1df5: Pull complete
c45b026a8a1c: Pull complete
385544f41f6c: Pull complete
e3f25b0828bf: Pull complete
Digest: sha256:23793cf16803fbe4e0c77da587e216788dd0858800481468211b1d2ac2382acb
Status: Downloaded newer image for zixia/wechaty:latest

$ function wechaty() {
>   sudo docker run \
>     -t -i --rm \
>     -e WECHATY_LOG="$WECHATY_LOG" \
>     --volume="$(pwd)":/bot \
>     zixia/wechaty:latest \
>     "$@"
> }

zixia@blinder:~/git/wechaty$ wechaty example/ding-dong-bot.ts

 __        __        _           _
 \ \      / /__  ___| |__   __ _| |_ _   _
  \ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
   \ V  V /  __/ (__| | | | (_| | |_| |_| |
    \_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
                                     |___/
____________________________________________________
            https://www.chatie.io
  ____                            _   _
 / ___|___  _ __  _ __   ___  ___| |_(_)_ __   __ _
| |   / _ \| '_ \| '_ \ / _ \/ __| __| | '_ \ / _` |
| |__| (_) | | | | | | |  __/ (__| |_| | | | | (_| |
 \____\___/|_| |_|_| |_|\___|\___|\__|_|_| |_|\__, |
                                              |___/
  ____ _           _   ____        _
 / ___| |__   __ _| |_| __ )  ___ | |_ ___
| |   | '_ \ / _` | __|  _ \ / _ \| __/ __|
| |___| | | | (_| | |_| |_) | (_) | |_\__ \
 \____|_| |_|\__,_|\__|____/ \___/ \__|___/


Starting Wechaty v0.11.42 with Node.js v8.8.1 ...
Working directory: /bot
Please make sure you had installed all the NPM modules which is depended by your bot script.
Executing ts-node example/ding-dong-bot.ts

| __        __        _           _
| \ \      / /__  ___| |__   __ _| |_ _   _
|  \ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
|   \ V  V /  __/ (__| | | | (_| | |_| |_| |
|    \_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
|                                     |___/

=============== Powered by Wechaty ===============
-------- https://github.com/chatie/wechaty --------

I'm a bot, my super power is talk in Wechat.

If you send me a 'ding', I will reply you a 'dong'!
__________________________________________________

Hope you like it, and you are very welcome to
upgrade me for more super powers!

Please wait... I'm trying to login in...


10:59:06 INFO Wechaty v0.11.45 starting...
https://login.weixin.qq.com/qrcode/wZFwVQB-8g==
[0] Scan QR Code in above url to login:
https://login.weixin.qq.com/qrcode/wZFwVQB-8g==
[201] Scan QR Code in above url to login:
https://login.weixin.qq.com/qrcode/wZFwVQB-8g==
[200] Scan QR Code in above url to login:
16:42:38 INFO Bot 李卓桓 logined
<李卓桓>:{TEXT}Wechaty login
^CWechaty exit 130 because of SIGINT
 Script terminated by Control-C
   ____ _        _            ____
  / ___| |_ _ __| |    _     / ___|
 | |   | __| '__| |  _| |_  | |
 | |___| |_| |  | | |_   _| | |___
  \____|\__|_|  |_|   |_|    \____|


 __        __        _           _
 \ \      / /__  ___| |__   __ _| |_ _   _
  \ \ /\ / / _ \/ __| '_ \ / _` | __| | | |
   \ V  V /  __/ (__| | | | (_| | |_| |_| |
    \_/\_/ \___|\___|_| |_|\__,_|\__|\__, |
                                     |___/
____________________________________________________
            https://www.chatie.io
  _____      _ _     _ _____  ___
 | ____|_  _(_) |_  / |___ / / _ \
 |  _| \ \/ / | __| | | |_ \| | | |
 | |___ >  <| | |_  | |___) | |_| |
 |_____/_/\_\_|\__| |_|____/ \___/

zixia@blinder:~/git/wechaty$

@huan
Copy link
Member

huan commented Feb 7, 2018

Close this issue due to inactive for months.

Hope this issue had been resolved.

@huan huan closed this as completed Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants