Differences between Typescript, Tsc, and Ntypescript

It all began when the command tsc --init refused to work...

I'm curious, what sets apart these three commands:

npm install -g typescript
npm install -g tsc
npm install -g ntsc

Initially, I assumed "tsc" was just an abbreviation for typescript, but listing them out reveals potential differences in versions.

PS C:\angular2-app> npm list -g tsc
C:\Users\Wheeeeee\AppData\Roaming\npm
└── [email protected]

PS C:\angular2-app> npm list -g typescript
C:\Users\Wheeeeee\AppData\Roaming\npm
└── [email protected]

So, what exactly distinguishes between the two. Could it be that typescript is the library while tsc serves as some sort of command line assist?

P.S. Not overly concerned about ntsc, just throwing it in the mix in case you have any insights on it. Otherwise, feel free to disregard.

EDIT: With the response below in mind, how does Powershell discern which tsk I am attempting to utilize? How can I specify?

Answer №1

tsc refers to a package with an identical name as the TypeScript compiler used in the command line interface. On the other hand, typescript is the official package for TypeScript.

Answer №2

When it comes to choosing the latest version for TypeScript, there are a few options available:

./node_modules/.bin/tsc --help
Version 1.5.3 (from <a href="https://github.com/basarat/tsc" rel="nofollow noreferrer">https://github.com/basarat/tsc</a>)
./node_modules/.bin/tsc --help
Version 2.5.0 (from <a href="https://github.com/basarat/ntypescript" rel="nofollow noreferrer">https://github.com/basarat/ntypescript</a>)
./node_modules/.bin/tsc --help
Version 4.0.2 (from <a href="https://github.com/Microsoft/TypeScript" rel="nofollow noreferrer">https://github.com/Microsoft/TypeScript</a>)

All these versions are connected in some way. Initially created by https://github.com/basarat, the project eventually gained sponsorship from Microsoft https://github.com/Microsoft/TypeScript.

If you want the most advanced features, using

"typescript": "latest"
is the way to go. It's recommended to stick with this option for the best experience.

Additionally, the list of supported targets and libraries is continuously updated for

"typescript": "latest"
.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Encountering a compilation error due to a Typescript assignment

While working with Typescript, I encountered a compilation error in the code shown below: console.log('YHISTORY:login: data = '+data); let theData = JSON.parse(data); console.log('YHISTORY:login: theData = '+JSON.stringify(theData)); ...

Utilizing the toastr service through Angular injections

I am looking to manage common HTTP errors by using the Angular Materials MDSnackbar service. However, I am struggling to figure out how to implement it properly. When I add MdSnackBar to the constructor like private mdsnackbar: MdSnackBar, it gives me an e ...

Resolving the error "Property not found on type 'any[]' after retrieving an object from the database in Typescript"

Being a beginner in the world of TypeScript, I am struggling to comprehend the error message and how to resolve it. This is the snippet of my code: app.put('/compareSpread' , async (req , res) => { const { roundedSpreadPercentage , cropId} ...

Angular 14: Deleting an item from a FormArray triggers unintended form submission due to Angular animation

After beginning to create animations for my app, I observed that deleting an element from a FormArray triggers a form submission. Custom form controls were developed using ControlValueAccessor, and certain FormGroups are passed through @Inputs. The animati ...

The initial setting of [opened]="true" causes an issue with the Angular Material date range picker

Recently, we completed the upgrade of our app from Angular 14 to 15.2.9, which includes Angular Material. The migration process went smoothly, and now our app is compiling and running without any errors. However, we encountered an issue with the mat-date-r ...

Adding a fresh element to an array in Angular 4 using an observable

I am currently working on a page that showcases a list of locations, with the ability to click on each location and display the corresponding assets. Here is how I have structured the template: <li *ngFor="let location of locations" (click)="se ...

transferring information seamlessly in Ionic using Angular router without the need for navigation

I have a list of names that are displayed, and when I click on any name in the list, it should take me to another page without actually navigating to that path. names.page.html: <ion-content> <ion-list *ngFor='let person of people'&g ...

What role does the empty object type {} play in typescript?

In the @types/React package of the DefinitelyTyped library, I came across this definition: interface FunctionComponent<P = {}> { (props: PropsWithChildren<P>, context?: any): ReactElement | null; propTypes?: WeakValidationMap&l ...

Testing Angular Components: Accessing HTML Elements by Data-QA Tag Attribute

Currently, I am in the process of writing unit tests for Angular and looking to retrieve the value of a custom textbox using the data-qa attribute. You can refer to this article for more information: https://dev.to/chriszie/data-qa-attribute-a-better-way-t ...

Failure of React to connect event handlers

LATEST UPDATE: After removing the output entry from my webpack configuration, the React event listeners are now functioning correctly. Currently, I am diving into the world of hand-rolling webpack configurations for a React/TypeScript application for the ...

tips for choosing an entire group in ng-select with Angular

I am implementing a multi-select dropdown with groups in Angular using the ng-select component. My goal is to allow users to select an entire group and have all items within that group automatically selected as well. I have been attempting to model my cod ...

Tips for combining Angular 2 with a current J2EE Spring project and deploying them on the same PORT

I currently have a project with Spring on the back-end and AngularJS 1 on the front-end. When I start the Spring server, it only opens one port for me: 8080 which allows me to access REST APIs and the AngularJS front-end components. https://i.stack.imgur. ...

Enhance your Next.js routing by appending to a slug/url using the <Link> component

In my Next.js project, I have organized my files in a folder-based structure like this: /dashboard/[appid]/users/[userid]/user_info.tsx When using href={"user_info"} with the built-in Next.js component on a user page, I expect the URL to dynamic ...

A Guide to Implementing Inner CSS in Angular

I am working with an object named "Content" that has two properties: Content:{ html:string; css:string } My task is to render a div based on this object. I can easily render the html using the following code: <div [innnerHtml]="Content.html"& ...

Error: Element type is invalid: a string was anticipated, but not found

I recently experimented with the example provided in React's documentation at this link and it functioned perfectly. My objective now is to create a button using material-ui. Can you identify what is causing the issue in this code? import * as R ...

A comprehensive guide on using HttpClient in Angular

After following the tutorial on the angular site (https://angular.io/guide/http), I'm facing difficulties in achieving my desired outcome due to an error that seems unclear to me. I've stored my text file in the assets folder and created a config ...

Custom JSX element failing to include children during addition

I have created a unique component in JSX, like this: const CustomComponent = ({content}) => { return <div className={content}></div>; } I am using it as follows: <CustomComponent content={"xyz"}> <p>Some additio ...

Extract the JSON array data from the Service and process it within the Component

When passing a response from the Service to the Component for display on the UI, each value needs to be parsed and stored in a variable. This can be achieved by extracting values such as profileId, profileName, regionName, etc. from the response. [{"profi ...

Utilizing Angular and ASP .Net Web Api in conjunction with Plesk hosting platform

I have successfully created a website using Angular and .NET Framework 5.0. I was able to publish the Angular portion on Plesk and it is working correctly, but I am facing challenges in publishing the .NET Framework app and connecting it with Angular. ...

Error: The variable "prisma" is not defined in this context - Next.js version 14

While working with Prisma and next.js 14, I encountered an issue with the Stripe payment API. The error message ReferenceError: prisma is not defined popped up. How can I resolve this? import { NextApiRequest, NextApiResponse } from "next" import ...