wechaty / getting-started

A Starter Project Template for Wechaty works out-of-the-box
https://gitpod.io/#https://github.com/wechaty/wechaty-getting-started
Apache License 2.0
774 stars 342 forks source link

我本地搭建的,按照本地搭建视频教程,报以下错误 #232

Closed brotherbear2008 closed 2 years ago

brotherbear2008 commented 2 years ago

file:///Users/macbookpro/Documents/ding-dong-bot/ding-dong-bot.js:1 import {Wecharty, ScanStatus, log} from "wechaty" ^^^^^^^^ SyntaxError: The requested module 'wechaty' does not provide an export named 'Wecharty' at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21) at async ModuleJob.run (node:internal/modules/esm/module_job:181:5) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:281:24) at async loadESM (node:internal/process/esm_loader:88:5) at async handleMainPromise (node:internal/modules/run_main:65:12)

huan commented 2 years ago

The video tutorial is outdated, it's for Wechaty v0.x (before Nov 2021)

The current latest version is v1.x (after Nov 2021),

You need to follow the latest example code at https://github.com/wechaty/getting-started/blob/main/examples/ding-dong-bot.ts

lijiarui commented 2 years ago

You have a typo here: import {Wecharty, ScanStatus, log} from "wechaty"

Wechaty, not Wecharty