# Download and install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.3/install.sh | bash
# in lieu of restarting the shell
\. "$HOME/.nvm/nvm.sh"
# Download and install Node.js:
nvm install 22
# Verify the Node.js version:
node -v # Should print "v22.15.0".
nvm current # Should print "v22.15.0".
# Verify npm version:
npm -v # Should print "10.9.2".npm install -g typescriptCheck Version
tsc -v- First install
tscfor typescript :
sudo apt install node-typescript- Generate New
tsconfig.jsonfile :
tsc --init- Configure the file :
Search and Comment out
"rootDir": "./module1/src/", Example : if your path root_directory/module1/src/index.ts
"outDir": "./module1/dist",Example : if your path root_directory/module1/dist/index.js
- After setup all config then open terminal on root directory and just type
tscand enter. It will generate or updated thejsofts
visit : https://www.npmjs.com/package/ts-node-dev
To see instant changes data in terminal by typescript.
Install Globally
sudo npm i -g ts-node-devRun the specific file
ts-node-dev --respawn --transpile-only module1/src/1.11-Ternary-optiona.tshere my file path loaction is : /var/www/html/typescript-technocrat/module1/src/1.11-Ternary-optiona.ts