Emmanuel Gabion
Emmanuel Gabion

Reputation: 425

Cannot install TypeScript globally

I've been using this node command:

npm install -g typescript

However, the downloaded package always goes to C:\Program Files\Git\usr\local\tsserver.

When tsc -v is called outside Git directory, it prints the following message:

'tsc' is not recognized as an internal or external command, operable program or batch file.

Upvotes: 2

Views: 7968

Answers (2)

Aiman Ali
Aiman Ali

Reputation: 21

Try the below command on Unix prompt:

sudo npm install -g typescript

Upvotes: 2

Léo R.
Léo R.

Reputation: 2708

I think your npm path is not correctly defined

Run this:

npm config get prefix

The default is C:\usr\local, which means that npm will symlink binaries into C:\usr\local\bin , which should already be on your PATH.

So run :

npm config set prefix C:\Usr\local

Finnaly, If NPM is not in your path run this :

set PATH=%PATH%;C:\Usr\local

Upvotes: 2

Related Questions