reactjs - Lỗi TypeScript trong /home/Documents/node_modules/cheerio-select/lib/index.d.ts(1,15): [0] Đã mong đợi ','. TS1005
Xin chào, tôi nhận được lỗi này trong terminal khi tôi chạy npm run dev & npm run build trong terminal của mình.
[0] Biên dịch thất bại. [0] [0] /home/Documents/frontend/node_modules/cheerio-select/lib/index.d.ts [0] Lỗi TypeScript trong /home/fislam/Documents/frontend/client-dashboard/node_modules/cheerio-select/lib/index.d.ts(1,15): [0] ',' mong đợi. TS1005 [0] [0] > 1 | import { type Options as CSSSelectOptions } from "css-select"; [0] | ^[0] 2 | import type { Element, AnyNode, Document } from "domhandler"; [0] 3 | export { filters, pseudos, aliases } from "css-select"; [0] 4 | export interface Options extends CSSSelectOptions<AnyNode, Element> { ^C[1] THÔNG TIN: Bắt tín hiệu: SIGINT [1] [nodemon] thoát [1] npm run dev:server --silent thoát với mã SIGINT [0] npm run dev:client --silent thoát với mã SIGINT
Câu trả lời #1
Vấn đề đối với tôi là tôi đã sử dụng phiên bản cheerio lỗi thời. Tôi đã khắc phục nó bằng cách chạy
yarn add cheerio@latest
Bạn cũng có thể thử cập nhật TS của mình lên phiên bản mới nhất bằng cách chạy
npm install -g typescript@latest
