Search code examples
javascriptnode.jsreactjsyarnpkg

yarn eg:'live-server' is not recognized as an internal or external command


I am using yarn v1.6.0 as a dependency manager, I have installed live-server globally by using the following command: yarn global-add live-server

But when executed it like live server, it is giving the following error:

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

It is obvious my path is not configured Can some help which path should I use an environment variable?


Solution

    1. Firstly check your computer whether the node.js is installed or not (if not: downloaded from internet)(command promt)
    2. After installed the node.js go to command prompt type npm install -g live-server (command promt).
    3. Go to vs code (help>new terminal) and then type: set-ExecutionPolicy RemoteSigned -Scope CurrentUser
    4. After execuction type:Get-ExecutionPolicy.
    5. Again execution type:Get-ExecutionPolicy -list.
    6. After that type : live-server.
    7. Done

    problem solved.