Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,4 @@
1. After transpilation, you'll find a corresponding JavaScript file in your project directory.
2. Run the JavaScript file using Node.js with the command: `node index.js`
3. You should see the output: `This is my first line of code`

23 changes: 13 additions & 10 deletions class02/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ Inquirer is a powerful library for creating command-line interfaces in Node.js.

Before using Inquirer, ensure you have Node.js installed. Then, install Inquirer using npm:
Run Following 3 Commands in your project deirectory

```bash
tsc --init
npm install inquirer
npm i @types/node -D
npm i @types/inquirer -D
Expand All @@ -18,22 +20,23 @@ npm i @types/inquirer -D
import inquirer from "inquirer";

let Name = await inquirer.prompt([{
name: "name",
message: "Enter your name?",
type: "input",
name: "name",
message: "Enter your name?",
type: "input",
}]);

console.log("Hello, " + name + "!");

console.log("Hello, " + Name.name + "!");

```
### Some Important Points To Avoid Errors:

1. In your `tsconfig.json` file, on line `25`. change `module` value from `commonJs` to `NodeNext` :
`"module": "NodeNext",`
1. In your `tsconfig.json` file, on line `14` change `"target": es2016` to `"target": es2022`

2. In your `tsconfig.json` file, on line `28`. change `"module": "commonjs"` to `"module": "NodeNext"`

2. In your `tsconfig.json` file, on line `27` . set `moduleResolution` to `NodeNext` :
`"moduleResolution": "NodeNext",`
3. In your `tsconfig.json` file, on line `30` . set `"moduleResolution": "node10"` to `"moduleResolution": "NodeNext",` and remain uncomment

3. In your `package.json` file, Add Following code` :
4. In your `package.json` file, Add Following code` :

`"type": "module",`

Expand Down