Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

bash: tslint: command not found

I tried use tslint --fix but get bash: tslint: command not found....

I installed tslint using command: yarn global add tslint typescript.

My machine use Centos 7.

like image 606
Edgaras Karka Avatar asked Dec 11 '17 12:12

Edgaras Karka


People also ask

How do I run a Tslint command line?

tslint accepts the following command-line options: -c, --config: The location of the configuration file that tslint will use to determine which rules are activated and what options to provide to the rules. If no option is specified, the config file named tslint. json is used, so long as it exists in the path.

Why is TSC not found?

To solve the error "tsc: command not found", install the typescript package globally by running npm install typescript@latest -g or use the npx command with the --package flag, e.g. npx --package typescript tsc --init . The fastest way to solve the error is to use the npx command with the --package flag.


2 Answers

I've run into the same problem recently. Yarn output says it added "tslint" binary, but it's lying. To actually install it you need to run Yarn as root, so:

sudo yarn global add tslint typescript
like image 77
pevel Avatar answered Oct 14 '22 04:10

pevel


I needed to delete the /node_modules folder and run npm install and it was fixed again

like image 39
dang Avatar answered Oct 14 '22 05:10

dang