Open luojingwenaihemiao opened 1 month ago
相关依赖没有导致
感谢回复!可是你们提供的GitHub codespace已经自动安装了相关的依赖了呀?具体还缺少什么依赖呢?谢谢!
@@. / @@.
------------------ Original ------------------ From: SuperChang @.> Date: Sat,Jul 27,2024 9:50 PM To: wechaty/puppet-supports @.> Cc: luojingwenaihemiao @.>, Author @.> Subject: Re: [wechaty/puppet-supports] [BUG]WorkPro: ts-node index.ts TSError: ⨯ Unable to compile TypeScript: index.ts:70:19 - error TS2552: Cannot find name 'URL'. Did you mean 'url'? (Issue #525)
相关依赖没有导致
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
我也遇到了,没写过node代码,搞了个挫的代替下:
const getQrcodeKey = (urlStr: string) => { const url = new URL(urlStr); return url.searchParams.get('key'); } 改成: const getQrcodeKey = (urlStr: string) => { const str_begin = "key=" const str_end = "&" const index_begin = urlStr.indexOf(str_begin); const index_end = urlStr.indexOf(str_end); const str_key = urlStr.slice(index_begin+4, index_end) console.log(str_key) return str_key
}
Please make sure you have read the Wechaty Puppet Service: WorkPro from Wechaty Official Website before you continue writing this issue.
--- YES, I have checked with that already.
Describe the bug
Follow #267 to try the codespace. After command the npm start, it shows up following error log:
$ npm start
/usr/local/share/nvm/versions/node/v20.15.1/lib/node_modules/ts-node/src/index.ts:859 return new TSError(diagnosticText, diagnosticCodes, diagnostics); ^ TSError: ⨯ Unable to compile TypeScript: index.ts:70:19 - error TS2552: Cannot find name 'URL'. Did you mean 'url'?
70 const url = new URL(urlStr);
diagnosticCodes: [ 2552 ]
Info
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Shows up the QR-code for logging on with Wecom account.
Screenshots
N/A