Skip to content
This repository has been archived by the owner on Jun 3, 2023. It is now read-only.

请问demo如何运行? #38

Open
phper5 opened this issue Oct 20, 2021 · 2 comments
Open

请问demo如何运行? #38

phper5 opened this issue Oct 20, 2021 · 2 comments

Comments

@phper5
Copy link

phper5 commented Oct 20, 2021

这个不算bug,抱歉不太懂js。我直接运行会提示 SyntaxError: Cannot use import statement outside a module
然后我把
import { Wechaty } from 'wechaty'
改成了
const { Wechaty } = require ('wechaty')

再运行就提示
Emitted 'error' event on Wechaty instance at:
at Wechaty.start (./node_modules/wechaty/dist/cjs/src/wechaty.js:568:18) {
code: 14,
details: 'No connection established',
metadata: Metadata { internalRepr: Map(0) {}, options: {} }
}

@phper5
Copy link
Author

phper5 commented Oct 20, 2021

代码就完全是首页Example里的代码, 我只是换了个token

@su-chang
Copy link
Collaborator

如果不太了解js,推荐你直接使用 wechaty-getting-start 项目中的案例直接运行。

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants