# TypeScript

**URL:** https://forum.codewithmosh.com/c/typescript/24.md?page=1

[Latest](https://forum.codewithmosh.com/latest.md) · [Categories](https://forum.codewithmosh.com/categories.md)

**Page:** 2

---

## [TS2688: Cannot find type definition file for 'node'](https://forum.codewithmosh.com/t/ts2688-cannot-find-type-definition-file-for-node/19107)

<div class="topic-metadata">

**Author:** [@fabiojpoli](https://forum.codewithmosh.com/u/fabiojpoli)\
**Replies:** 0\
**Last updated:** [March 24, 2023, 5:40pm UTC](https://forum.codewithmosh.com/t/ts2688-cannot-find-type-definition-file-for-node/19107 "2023-03-24T17:40:12Z")

</div>

trying to compile the “console.log(‘Hello World!’);” and this happens =/ $ tsc index.ts error TS2688: Cannot find type definition file for 'node'. The file is in the program because: Entry point for implicit type…

---

## [5- Configuring the TypeScript Compiler](https://forum.codewithmosh.com/t/5-configuring-the-typescript-compiler/17573)

<div class="topic-metadata">

**Author:** [@pedjak](https://forum.codewithmosh.com/u/pedjak)\
**Replies:** 7\
**Last updated:** [March 24, 2023, 5:37pm UTC](https://forum.codewithmosh.com/t/5-configuring-the-typescript-compiler/17573 "2023-03-24T17:37:53Z")

</div>

From some reason, I couldn’t configure ts compiler with tsc --init command and tsconfig.json file doesn’t show up. If some one could help what I am doing wrong.

---

## [TypeScript with Styled components](https://forum.codewithmosh.com/t/typescript-with-styled-components/18883)

<div class="topic-metadata">

**Author:** [@mechanicDev](https://forum.codewithmosh.com/u/mechanicDev)\
**Replies:** 5\
**Last updated:** [March 20, 2023, 8:15pm UTC](https://forum.codewithmosh.com/t/typescript-with-styled-components/18883 "2023-03-20T20:15:14Z")

</div>

Does anyone know why, when using styled-componets with react, you pass the component a reference to the entire interface instead of the idividual paramets in the interface? I am new to TS so I may be using some words inc…

---

## [Tsc holding old version on VS Code](https://forum.codewithmosh.com/t/tsc-holding-old-version-on-vs-code/18889)

<div class="topic-metadata">

**Author:** [@fabiojpoli](https://forum.codewithmosh.com/u/fabiojpoli)\
**Replies:** 0\
**Last updated:** [March 17, 2023, 10:41pm UTC](https://forum.codewithmosh.com/t/tsc-holding-old-version-on-vs-code/18889 "2023-03-17T22:41:55Z")

</div>

Even forcing to install the different version (sudo npm i -g typescript@4.6.3), VS Code still is using 2.8.3. I already deleted folder related, restarted my mac but still shows this old version. And because of that, whe…

---

## [TypeScript- Inheritance - Lecture11-12-13 has some issues when declaring the class Person and creating a getter](https://forum.codewithmosh.com/t/typescript-inheritance-lecture11-12-13-has-some-issues-when-declaring-the-class-person-and-creating-a-getter/17608)

<div class="topic-metadata">

**Author:** [@CatalinHora](https://forum.codewithmosh.com/u/CatalinHora)\
**Replies:** 1\
**Last updated:** [January 11, 2023, 12:41pm UTC](https://forum.codewithmosh.com/t/typescript-inheritance-lecture11-12-13-has-some-issues-when-declaring-the-class-person-and-creating-a-getter/17608 "2023-01-11T12:41:02Z")

</div>

class Person { constructor(public firstName: string, public lastName: string) { get fullName(): { return this.firstName + this.fullName; } walk() { console.log('Walking'); } } }

---

## [Class Decorator Solution no longer works](https://forum.codewithmosh.com/t/class-decorator-solution-no-longer-works/17361)

<div class="topic-metadata">

**Author:** [@cheffernan087](https://forum.codewithmosh.com/u/cheffernan087)\
**Replies:** 0\
**Last updated:** [December 31, 2022, 3:57pm UTC](https://forum.codewithmosh.com/t/class-decorator-solution-no-longer-works/17361 "2022-12-31T15:57:08Z")

</div>

The solution given for the decorators exercise in the typescript course is as follows: function Sauce(sauce: string) { return (constructor: Function) =\> { constructor.prototype.sauce = sauce; }; } however when I ran…

---

## [Does this course have coding exercises?](https://forum.codewithmosh.com/t/does-this-course-have-coding-exercises/17074)

<div class="topic-metadata">

**Author:** [@cfkyeahraze](https://forum.codewithmosh.com/u/cfkyeahraze)\
**Replies:** 2\
**Last updated:** [December 17, 2022, 9:20pm UTC](https://forum.codewithmosh.com/t/does-this-course-have-coding-exercises/17074 "2022-12-17T21:20:45Z")

</div>

I bought a few courses from mosh. And I can say that a lot of his courses doesn’t have enough coding exercises to play around. So, is this course have a lot of coding exercises to get my hands dirtyy?? Thankssss

---

## [Todo react ts app issues with remove title](https://forum.codewithmosh.com/t/todo-react-ts-app-issues-with-remove-title/16699)

<div class="topic-metadata">

**Author:** [@groppo91](https://forum.codewithmosh.com/u/groppo91)\
**Replies:** 0\
**Last updated:** [November 27, 2022, 9:40am UTC](https://forum.codewithmosh.com/t/todo-react-ts-app-issues-with-remove-title/16699 "2022-11-27T09:40:18Z")

</div>

The todo react app using ts is slightly broken unless I have missed something. When adding more than 1 new todo all new ones seem to share the id so when removing it errors and stops removing anything you added to the ar…

---

## [Typescript type error](https://forum.codewithmosh.com/t/typescript-type-error/16451)

<div class="topic-metadata">

**Author:** [@rosh-eth](https://forum.codewithmosh.com/u/rosh-eth)\
**Replies:** 1\
**Last updated:** [November 14, 2022, 2:42am UTC](https://forum.codewithmosh.com/t/typescript-type-error/16451 "2022-11-14T02:42:07Z")

</div>

I’m following the exercise to add a type to the array below but I get a complaint in Typescript with the following: “Type ‘{ name: string; age: number; occupation: string; }’ is missing the following properties from typ…

---

## [Classes, Interfaces, and Object-oriented Programming, 19 Exercises](https://forum.codewithmosh.com/t/classes-interfaces-and-object-oriented-programming-19-exercises/16135)

<div class="topic-metadata">

**Author:** [@EnsignRho](https://forum.codewithmosh.com/u/EnsignRho)\
**Replies:** 1\
**Last updated:** [October 28, 2022, 8:12pm UTC](https://forum.codewithmosh.com/t/classes-interfaces-and-object-oriented-programming-19-exercises/16135 "2022-10-28T20:12:49Z")

</div>

There is an implementation for the: let employee = { name:'John Smith', salary:50\_000, address:{ street:'Flinders st', city:'Melbourne', zipCode:3144, }, } That looks like this: …

---

## [Advanced 8-The Nullish Coaelscing Operator](https://forum.codewithmosh.com/t/advanced-8-the-nullish-coaelscing-operator/16019)

<div class="topic-metadata">

**Author:** [@EnsignRho](https://forum.codewithmosh.com/u/EnsignRho)\
**Replies:** 0\
**Last updated:** [October 23, 2022, 6:54pm UTC](https://forum.codewithmosh.com/t/advanced-8-the-nullish-coaelscing-operator/16019 "2022-10-23T18:54:18Z")

</div>

The title of this lesson is spelled incorrectly. It should be “Coalescing.”

---

## [Anyone has the full Typescript courses from Mosh,](https://forum.codewithmosh.com/t/anyone-has-the-full-typescript-courses-from-mosh/14930)

<div class="topic-metadata">

**Author:** [@Muhammadjon](https://forum.codewithmosh.com/u/Muhammadjon)\
**Replies:** 7\
**Last updated:** [September 6, 2022, 5:37am UTC](https://forum.codewithmosh.com/t/anyone-has-the-full-typescript-courses-from-mosh/14930 "2022-09-06T05:37:48Z")

</div>

I would like to have access to Typescript paid version.

---

## [Why use interfaces instead of types?](https://forum.codewithmosh.com/t/why-use-interfaces-instead-of-types/14590)

<div class="topic-metadata">

**Author:** [@DiegoMcD](https://forum.codewithmosh.com/u/DiegoMcD)\
**Replies:** 1\
**Last updated:** [August 21, 2022, 3:37pm UTC](https://forum.codewithmosh.com/t/why-use-interfaces-instead-of-types/14590 "2022-08-21T15:37:03Z")

</div>

On the sections for creating the react app and express server Mosh creates interfaces instead of types. for example, from the express lecture 6- Parsing Request Bodies: What is created: interface CreateReminderDto { t…

---

## [Best resource for learning Typescript?](https://forum.codewithmosh.com/t/best-resource-for-learning-typescript/9772)

<div class="topic-metadata">

**Author:** [@agiantkorean](https://forum.codewithmosh.com/u/agiantkorean)\
**Replies:** 1\
**Last updated:** [August 21, 2022, 3:27am UTC](https://forum.codewithmosh.com/t/best-resource-for-learning-typescript/9772 "2022-08-21T03:27:20Z")

</div>

I didn’t see a Typescript course under the Code with Mosh courses. What would you recommend for learning Typescript? I’m OK with Javascript - I could be better at it, but I can get things done.

---

## [Typescript select query](https://forum.codewithmosh.com/t/typescript-select-query/14416)

<div class="topic-metadata">

**Author:** [@franciscop](https://forum.codewithmosh.com/u/franciscop)\
**Replies:** 7\
**Last updated:** [August 15, 2022, 11:49pm UTC](https://forum.codewithmosh.com/t/typescript-select-query/14416 "2022-08-15T23:49:00Z")

</div>

Hello Everyone, I am new to Node/Typescript and I am trying to create a simple query but I am having some issues on returning the result of my query. Here’s my code: app.get("/info", async (req: Request, res: Respons…

---

## [How recent is the typescript course?](https://forum.codewithmosh.com/t/how-recent-is-the-typescript-course/14307)

<div class="topic-metadata">

**Author:** [@DiegoMcD](https://forum.codewithmosh.com/u/DiegoMcD)\
**Replies:** 3\
**Last updated:** [August 13, 2022, 1:59pm UTC](https://forum.codewithmosh.com/t/how-recent-is-the-typescript-course/14307 "2022-08-13T13:59:58Z")

</div>

I’m interested in doing the Typescript course but I’ve learned (the hard way) from udemy that a lot of courses are a number of years old, and because software changes so quickly are outdated. The usual trick on udemy is…

---

## [Typescript generics - how to convert c# code](https://forum.codewithmosh.com/t/typescript-generics-how-to-convert-c-code/13078)

<div class="topic-metadata">

**Author:** [@Gleedo](https://forum.codewithmosh.com/u/Gleedo)\
**Replies:** 2\
**Last updated:** [June 18, 2022, 3:08pm UTC](https://forum.codewithmosh.com/t/typescript-generics-how-to-convert-c-code/13078 "2022-06-18T15:08:41Z")

</div>

Hi all, Sorry for posting here but there doesn’t seem to be a Typescript forum yet. I have bought the Typescript course and tried to consume the generics section, but I still can’t quite figure this out. I would like t…

---

## [Typescript : Element implicitly has an 'any' type because expression of type 'string' can't be used to index type](https://forum.codewithmosh.com/t/typescript-element-implicitly-has-an-any-type-because-expression-of-type-string-cant-be-used-to-index-type/12689)

<div class="topic-metadata">

**Author:** [@AzharUddinSheikh](https://forum.codewithmosh.com/u/AzharUddinSheikh)\
**Replies:** 4\
**Last updated:** [June 13, 2022, 9:04pm UTC](https://forum.codewithmosh.com/t/typescript-element-implicitly-has-an-any-type-because-expression-of-type-string-cant-be-used-to-index-type/12689 "2022-06-13T21:04:22Z")

</div>

I am working on the react with typescript check out the code below I have added js in category no typescript category available sorry for that class LoginForm extends React.Component\<LoginFormProps, LoginFormState\> { …

---

## [Typescript interface problem](https://forum.codewithmosh.com/t/typescript-interface-problem/12907)

<div class="topic-metadata">

**Author:** [@clonglam](https://forum.codewithmosh.com/u/clonglam)\
**Replies:** 2\
**Last updated:** [June 8, 2022, 3:27am UTC](https://forum.codewithmosh.com/t/typescript-interface-problem/12907 "2022-06-08T03:27:56Z")

</div>

I taken the course of ultimate typescript, but when I particularly want to try to fetch data form an api structure like the Image. I found that I Dont know what should do. I should define all the interface like inte…

---

## [TypeScript Property Decorators](https://forum.codewithmosh.com/t/typescript-property-decorators/12894)

<div class="topic-metadata">

**Author:** [@drullo](https://forum.codewithmosh.com/u/drullo)\
**Replies:** 1\
**Last updated:** [June 7, 2022, 1:27pm UTC](https://forum.codewithmosh.com/t/typescript-property-decorators/12894 "2022-06-07T13:27:43Z")

</div>

In the TypeScript course, the code in the Property Decorators section does not work for me. I have confirmed that the MinLength function does get called and that the return statement within it also gets called. I’ve pl…

---

## [Questions for the typescript course that is on the way🙏🥳](https://forum.codewithmosh.com/t/questions-for-the-typescript-course-that-is-on-the-way/12473)

<div class="topic-metadata">

**Author:** [@sam1](https://forum.codewithmosh.com/u/sam1)\
**Replies:** 1\
**Last updated:** [June 5, 2022, 3:47pm UTC](https://forum.codewithmosh.com/t/questions-for-the-typescript-course-that-is-on-the-way/12473 "2022-06-05T15:47:34Z")

</div>

Hi Mosh, I saw that there is a Typescript course on the way! :partying\_face: I have some questions and I wondered if you can refer them on your upcoming course: When should I use Type and when should I prefer Class? C…

---

## [Learning Typescript](https://forum.codewithmosh.com/t/learning-typescript/6794)

<div class="topic-metadata">

**Author:** [@SureshP](https://forum.codewithmosh.com/u/SureshP)\
**Replies:** 3\
**Last updated:** [August 20, 2021, 10:49am UTC](https://forum.codewithmosh.com/t/learning-typescript/6794 "2021-08-20T10:49:53Z")

</div>

Hi all, Please help me to understand, in order to learn Typescript one should know JavaScript? Please advise.

[Previous page](https://forum.codewithmosh.com/c/typescript/24.md)
