When using Node Package Manager, your package.json file may contain scripts like the following:
(dependencies and devDependencies omitted)..
"scripts": {
"start": "concurrently \"npm run tscwatch\" \"npm run lite\" ",
"tsc": "tsc",
"tscwatch": "tsc -w",
"lite": "lite-server",
"typings": "typings",
"postinstall": "typings install"
}
To run your application, navigate to the folder level you are at and type:
npm install
Then,
npm start
The lite server will host your application and compile TypeScript to JavaScript if your tsconfig.json is set up correctly. If you're having trouble debugging TypeScript with Angular in VS Code, you can try adding a 'launch.json' configuration for NPM like this:
{
"type": "node",
"request": "launch",
"name": "Launch via NPM ProAngular Example",
"runtimeExecutable": "npm",
"args": ["${relativeFile}"],
"runtimeArgs": [
"start"
]
}
However, some users have reported issues with this approach resulting in error messages. Debugging TypeScripts within an Angular environment in VS Code can be challenging, but there are alternative configurations and methods available.