`tsc` compiling error: Cannot find namespace 'webdriver'
Created by: imWildCat
Hello zixia,
I was trying to use wechaty
in TypeScript. While compiling, there were errors:
node_modules/wechaty/dist/src/puppet-web/browser-driver.d.ts(18,13): error TS2503: Cannot find namespace 'webdriver'.
node_modules/wechaty/dist/src/puppet-web/server.d.ts(2,1): error TS2688: Cannot find type definition file for 'socket.io'
.
node_modules/wechaty/dist/src/puppet-web/server.d.ts(11,19): error TS2503: Cannot find namespace 'SocketIO'.
node_modules/wechaty/dist/src/puppet-web/server.d.ts(12,19): error TS2503: Cannot find namespace 'SocketIO'.
node_modules/wechaty/dist/src/puppet-web/server.d.ts(27,39): error TS2503: Cannot find namespace 'SocketIO'.
Only by adding these typings dependencies in my project (yarn add -D yarn add @types/selenium-webdriver @types/socket.io
) can solve this problem. Is there any better way? I do not tend to add these dependencies in the package.json
of my project.