Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

'http-server' is not recognized as an internal or external command

After installing angular-seed project, i did the following steps:

Cloned the repository :

git clone https://github.com/angular/angular-seed.git

cd angular-seed

Then I ran npm install

at the end of the install i get:

[email protected] prestart C:\Users\user\Documents\GitHub\comilion\angular-seed npm install

[email protected] postinstall C:\Users\user\Documents\GitHub\myproject\angular-seed bower install

[email protected] start C:\Users\user\Documents\GitHub\myproject\angular-seed http-server -a localhost -p 2324

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

npm ERR! [email protected] start: http-server -a localhost -p 2324 npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] start script. npm ERR! This is most likely a problem with the angular-seed package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR!
http-server -a localhost -p 2324 npm ERR! You can get their info via: npm ERR! npm owner ls angular-seed npm ERR! There is likely additional logging output above. npm ERR! System Windows_NT 6.1.7601 npm ERR! command "C:\Program Files\nodejs\\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "start" npm ERR! cwd C:\Users\user\Documents\GitHub\myproject\angular-seed npm ERR! node -v v0.10.22 npm ERR! npm -v 1.3.14 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR!
C:\Users\user\Documents\GitHub\myproject\angular-seed\npm-debug.log

please let me know if you have any suggestions how to solve this issue.

like image 445
Liad Livnat Avatar asked Jun 16 '14 13:06

Liad Livnat


People also ask

How do I fix not recognized as an internal or external command?

You can resolve this issue in three ways: First, use the full path of the executable file to launch the program. Second, add the program path to Windows environment variables. Finally, move the files to the System32 folder.

What is HTTP server command?

http-server is a simple, zero-configuration command-line static HTTP server. It is powerful enough for production usage, but it's simple and hackable enough to be used for testing, local development and learning.

How do I start an HTTP server?

Installing HTTP server using NPM Run the command line/terminal on your system (it doesn't matter which directory you are currently in). Execute npm install -g http-server . Once NPM finishes, you have the tiny HTTP-server installed. That's it.

How do I install HTTP?

Open a command prompt: Run as Administrator. Navigate to directory c:/Apache24/bin. Add Apache as a Windows Service: httpd.exe -k install -n "Apache HTTP Server"


2 Answers

@BenFortune found the answer it was

http-server needs to be installed globally with npm install -g http-server

like image 67
Liad Livnat Avatar answered Oct 19 '22 01:10

Liad Livnat


If the accepted solution did not work for you. Try the following. This solved the issue in my system.

Make sure the locations of both npm and http-server are added in environment variable 'PATH' (Both user variable and System variable).

If it is not present,

add C:\Users\username\AppData\Roaming\npm and C:\Users\username\AppData\Roaming\npm\node_modules\http-server to environment variable 'PATH'

like image 39
Nithin Baby Avatar answered Oct 19 '22 01:10

Nithin Baby