Avatar ·

خطأ "requires an imported helper but module 'tslib' cannot be found" عند استخدام وحدات ES2015 في TypeScript

مرحباً بالجميع! أنا جديد في TypeScript وأحاول إعداد مشروع. لدي ملف بسيط index.ts بهذا الكود:\n\n```typescript\nclass User {\n constructor(public name: string, public age: number) {}\n \n greet() {\n return `مرحباً، اسمي ${this.name}`;\n }\n}\n\nconst user = new User("آنا", 25);\nconsole.log(user.greet());\n```\n\nفي ملف tsconfig.json الخاص بي، قمت بتعيين:\n\n```json\n{\n "compilerOptions": {\n "target": "ES5",\n "module": "ES2015",\n "outDir": "./dist",\n "strict": true\n }\n}\n```\n\nعند تشغيل التجميع عبر `tsc`، أحصل على الخطأ:\n\n```\nerror TS2802: This syntax requires an imported helper but module 'tslib' cannot be found.\n```\n\nلقد بحثت عن هذا الخطأ على Google، لكنني لم أفهم تماماً ما يعنيه "imported helper" وم