Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
seyedasfar opened this issue May 4, 2019 · 29 comments

Comments

@seyedasfar
Copy link

I installed live-server as a global package but I got this message
Capture

@abachi
Copy link

abachi commented May 23, 2019

Did you install the package globally?

@seyedasfar
Copy link
Author

Did you install the package globally?

yeah, I did,

npm i -g live-server

@ps011
Copy link

ps011 commented Sep 19, 2019

This is occurring in my monorepo as well. Child projects are not able to find live-server although it is present in .bin directory inside node_modules

@Radha-4235
Copy link

after installig npm install -g live-server then i type live-server it is showing like ---'live-server' is not recognized as an internal or external command,
operable program or batch file.

Is there any solution to fix this issue

@seyedasfar seyedasfar reopened this Sep 23, 2019
@ExceededRed
Copy link

same problem here

@ghost
Copy link

ghost commented Oct 23, 2019

Has anyone one ever found a solution ?
I’m having the same issue here, in the trillo project.

@GeorgeMitsikaris
Copy link

In the trillo project I just installed it locally with 'npm install live-server --save-dev' and it works, but I don't know if it's better than to install it globally

@Saahib
Copy link

Saahib commented Dec 3, 2019

But how to install the package globally?
I have the same problem while NPM RUN START

@santisagg
Copy link

Had the same issue because I had installed live-server as an extension in VSCode. Try installing through npm globally with "npm install -g live-server" and run start script again. Fixed it for me.

@robertozh29
Copy link

Had the same issue because I had installed live-server as an extension in VSCode. Try installing through npm globally with "npm install -g live-server" and run start script again. Fixed it for me.

That worked for me, thank you

@tikavalery
Copy link

npm install live-server --save-dev

Hi guys,this worked for me as well.Thanks very much

@Zucci-Daniel
Copy link

hello guys, i'm having a problem in trillo's project, i can't run my normal "npm run start" command and i'm having problem installing the node-sass, even while i followed his command in the command line which is "npm install"....pls i need help!!! i've been sourcing for answers but none.

@seyedasfar
Copy link
Author

hello guys, i'm having a problem in trillo's project, i can't run my normal "npm run start" command and i'm having problem installing the node-sass, even while i followed his command in the command line which is "npm install"....pls i need help!!! i've been sourcing for answers but none.

what you get when executing the command

npm -v

@Zeesy
Copy link

Zeesy commented Oct 25, 2020

I'm getting a -bash: live-server: command not found error when running live-server command. Did an uninstall and reinstalled, same issue. MacOS, npm 7.0.3.

image

@Rai321han
Copy link

Rai321han commented Mar 10, 2021

_ THIS IS HOW IT WORKED FOR ME!_

I just installed it locally with 'npm install live-server --dev-save'
next, in the package.json file, I've added "server": "live-server" in the scripts block.
it works by running 'npm run server' in the command prompt.
live-server

@pramit-marattha
Copy link

How do I fix this error ?
Please! Help me..

"Error: listen EACCES: permission denied 0.0.0.0:8080"

image

@pramit-marattha
Copy link

How do I fix this error ?
Please! Help me..

"Error: listen EACCES: permission denied 0.0.0.0:8080"

image

Oh, wait!! Solved it 😅
If you are having the same issue just change the port to a different port number. It might be because of some port conflict.

liver-server --port=2468 index.html

@joel122002
Copy link

For me adding "%appdata%\npm" to path worked. To know how to set path you can follow this tutorial
https://www.java.com/en/download/help/path.html
Also after adding it to path make sure that you restart the terminal. If you are using a code editor's terminal (in my case WebStorm) and if it's still not working try restarting the editor or open a CMD window in the project directory. It should work by now. If it still doesn't work go to %appdata%\npm in the file explorer and check if you find a live-server.cmd file.
image
If you don't find it there you will have to reinstall the package.

@jaroslavdusek1
Copy link

npm install -g live-server

working for me, thanks

@ali-khanix
Copy link

If this is not working, try this too:

  1. Go to edit environment variables
  2. Click on the PATH and than edit it
  3. At the end of the line, put a (semicolon = ;)
  4. set the location of your npm package to it. EX: (C:\Users------\Roaming\npm;) if you are using windows 7, set the view of your windows to show hidden files, cuz the appdata folder is hidden.
    I hope this was helpful

@DonnovanJiles70122
Copy link

try typing npx live-server in the terminal to run

@drod1107
Copy link

Thanks, @DonnovanJiles70122 . I haven't had to use Live Server to render something in probably a year or more and somehow this is the first comment I've seen where it was suggested to use npx to run. Thanks for saving the day. 🙌

@Hari-Kode
Copy link

help me guys please no one way is work for me i tried almost every way .

@drod1107
Copy link

It's not a final solution but if you're using VS Code then just having the extension installed is enough - there's a button in the bottom ribbon across the bottom of the window in vs code which says something like "go live" and clicking that will automatically launch it in live server.

You can also delete both live-server globally and also locally in your project kill your node modules folder, package-lock.json, and any cache folders (like dist or parcel-cache depending on the stack you're using) and then rerun the live-server install. Sometimes I've had this issue because some other package installed some dependency that's the same dep but a different version number and the conflict kept live-server from finding the dep IT needed. Can't hurt to try. 🤷🏻‍♂️

@ABHI2211998
Copy link

npm install -g live-server

try npx live-server

@yadunandanks
Copy link

yadunandanks commented Sep 3, 2023

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.

@yadunandanks
Copy link

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.

@jaroslavdusek1
Copy link

jaroslavdusek1 commented Sep 3, 2023 via email

@guled153
Copy link

guled153 commented Sep 9, 2023

I'm getting a -bash: live-server: command not found error when running live-server command. Did an uninstall and reinstalled, same issue. MacOS, npm 7.0.3.

image

I'm getting a -bash: live-server: command not found error when running live-server command. Did an uninstall and reinstalled, same issue. MacOS, npm 7.0.3.

image

Did you solved this issue, current struggling with this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests