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

main.ts:11:17 - error TS2693: 'Wechaty' only refers to a type, but is being used as a value here. #11

Open
menghe999 opened this issue Jan 15, 2022 · 0 comments

Comments

@menghe999
Copy link

menghe999 commented Jan 15, 2022

问题复现

E:\project\wechaty-puppet-padlocal-demo>npm i
npm WARN [email protected] No repository field.

up to date in 1.859s

25 packages are looking for funding
  run `npm fund` for details


E:\project\wechaty-puppet-padlocal-demo>node -v
v14.8.0

E:\project\wechaty-puppet-padlocal-demo>npm -v
6.14.7

E:\project\wechaty-puppet-padlocal-demo> .\node_modules\.bin\ts-node .\main.ts

E:\project\wechaty-puppet-padlocal-demo\node_modules\ts-node\src\index.ts:513
    return new TSError(diagnosticText, diagnosticCodes)
           ^
TSError: ⨯ Unable to compile TypeScript:
main.ts:11:17 - error TS2693: 'Wechaty' only refers to a type, but is being used as a value here.

11 const bot = new Wechaty({
                   ~~~~~~~

    at createTSError (E:\project\wechaty-puppet-padlocal-demo\node_modules\ts-node\src\index.ts:513:12)
    at reportTSError (E:\project\wechaty-puppet-padlocal-demo\node_modules\ts-node\src\index.ts:517:19)
    at getOutput (E:\project\wechaty-puppet-padlocal-demo\node_modules\ts-node\src\index.ts:752:36)
    at Object.compile (E:\project\wechaty-puppet-padlocal-demo\node_modules\ts-node\src\index.ts:968:32)
    at Module.m._compile (E:\project\wechaty-puppet-padlocal-demo\node_modules\ts-node\src\index.ts:1056:42)
    at Module._extensions..js (internal/modules/cjs/loader.js:1272:10)
    at Object.require.extensions.<computed> [as .ts] (E:\project\wechaty-puppet-padlocal-demo\node_modules\ts-node\src\index.ts:1059:12)
    at Module.load (internal/modules/cjs/loader.js:1100:32)
    at Function.Module._load (internal/modules/cjs/loader.js:962:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:72:12)

E:\project\wechaty-puppet-padlocal-demo>

main.ts:11:17 - error TS2693: 'Wechaty' only refers to a type, but is being used as a value here.
ts新手,不知如何解决这个问题呢,请指教

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

1 participant