node_modules/_wechaty@0.13.36@wechaty/dist/src/config.d.ts(1,24): error TS2307: Cannot find module 'raven'.
Created by: forconz
package.json
{ "name": "wechaty-getting-started", "version": "1.0.0", "description": "Wechaty is super easy to use, especially when you are using Docker. This repo contains the code about the video tutorial.", "main": "index.js", "scripts": { "test": "echo "Error: no test specified" && exit 1" }, "repository": { "type": "git", "url": "git+https://github.com/lijiarui/wechaty-getting-started.git" }, "keywords": [], "author": "", "license": "ISC", "bugs": { "url": "https://github.com/lijiarui/wechaty-getting-started/issues" }, "homepage": "https://github.com/lijiarui/wechaty-getting-started#readme", "dependencies": { "qrcode-terminal": "^0.11.0", "wechaty": "^0.13.36", "fs":"^0.0.1-security" } }
tsconfig.json { "compilerOptions": { "target": "es6", "module": "commonjs", "strict": true } }
copy contact-bot.ts from :https://github.com/chatie/wechaty/tree/master/example
now, set tup launch.json:
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"program": "${workspaceRoot}/node_modules/ts-node/dist/_bin.js",
"args": [
"${workspaceRoot}/contact-bot.ts" // 入口文件
],
"cwd": "${workspaceRoot}"
}
]
}
Ctrl+ Shift + B
Executing task: tsc -p "c:\Users\lenovo\Downloads\contact-bot\tsconfig.json" <
node_modules/_wechaty@0.13.36@wechaty/dist/src/config.d.ts(1,24): error TS2307: Cannot find module 'raven'. node_modules/_wechaty@0.13.36@wechaty/dist/src/config.d.ts(2,20): error TS2307: Cannot find module 'brolog'. node_modules/_wechaty@0.13.36@wechaty/dist/src/puppet-web/bridge.d.ts(21,47): error TS2307: Cannot find module 'puppeteer'. node_modules/_wechaty@0.13.36@wechaty/dist/src/puppet-web/puppet-web.d.ts(19,26): error TS2307: Cannot find module 'watchdog'. node_modules/_wechaty@0.13.36@wechaty/dist/src/puppet.d.ts(21,29): error TS2307: Cannot find module 'state-switch'. node_modules/_wechaty@0.13.36@wechaty/dist/src/puppet.d.ts(22,30): error TS2307: Cannot find module 'watchdog'. 通过退出代码 1 终止的终端进程
终端将被任务重用,按任意键关闭。