VSCode中编译含有cheerio的一个小爬虫报错,为什么找不到Document?
VSCode中编译含有cheerio的一个TypeScript语言编写的小爬虫,报错。
其中使用了npm插件cheerio。
编译报错如下:
> tsc -p ./src
node_modules/.0.17.31@@types/cheerio/index.d.ts(120,36): error TS2304: Cannot find name 'Document'.
node_modules/.0.17.31@@types/cheerio/index.d.ts(131,21): error TS2304: Cannot find name 'Document'.
node_modules/.0.17.31@@types/cheerio/index.d.ts(132,21): error TS2304: Cannot find name 'Document'.
node_modules/.0.17.31@@types/cheerio/index.d.ts(136,22): error TS2304: Cannot find name 'Document'.
node_modules/.0.17.31@@types/cheerio/index.d.ts(137,22): error TS2304: Cannot find name 'Document'.
node_modules/.0.17.31@@types/cheerio/index.d.ts(141,20): error TS2304: Cannot find name 'Document'.
node_modules/.0.17.31@@types/cheerio/index.d.ts(142,20): error TS2304: Cannot find name 'Document'.
node_modules/.0.17.31@@types/cheerio/index.d.ts(146,26): error TS2304: Cannot find name 'Document'.
node_modules/.0.17.31@@types/cheerio/index.d.ts(150,21): error TS2304: Cannot find name 'Document'.
node_modules/.0.17.31@@types/cheerio/index.d.ts(151,21): error TS2304: Cannot find name 'Document'.
node_modules/.0.17.31@@types/cheerio/index.d.ts(155,27): error TS2304: Cannot find name 'Document'.
node_modules/.0.17.31@@types/cheerio/index.d.ts(233,39): error TS2304: Cannot find name 'Document'.
node_modules/.0.17.31@@types/cheerio/index.d.ts(233,73): error TS2304: Cannot find name 'Document'.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\sunru\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "run" "compile"
npm ERR! node v5.6.0
npm ERR! npm v3.8.9
npm ERR! code ELIFECYCLE
npm ERR! ts-sexy-craw@0.0.0 compile: `tsc -p ./src`
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the ts-sexy-craw@0.0.0 compile script 'tsc -p ./src'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ts-sexy-craw package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! tsc -p ./src
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ts-sexy-craw
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ts-sexy-craw
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! e:\GitCode\xxxx\npm-debug.log
百思不得其解
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论