"eslint" is not recognized as an internal or external command

I am trying to install eslint and run it in code vs. I ran this command:

npm i -g eslint

and it seems to work, but I keep getting the error message "eslint" is not recognized as an internal or external command when trying to start eslint. What gives?

http://eslint.org/docs/user-guide/command-line-interface

http://eslint.org/docs/user-guide/getting-started

+4
source share
2 answers

The module eslintmust not be installed in the global.

instead, you should install the module eslint-cliin global.

, eslint-cli gloablly:

npm -g i eslint-cli

: eslint

npm i eslint --save-dev

: ( Windows)

eslint .\
+5

, Windows eslint-cli , :

node node_modules\eslint\bin\eslint.js --init

.

0

All Articles