http-server icon indicating copy to clipboard operation
http-server copied to clipboard

Unable to start the server

Open skmvasu opened this issue 12 years ago • 7 comments

I'm not able to start the server. I keep hitting the following error.

http-server -p 9999

/usr/local/lib/node_modules/http-server/bin/http-server:21 " -o Open browser window after staring the server", ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ SyntaxError: Unexpected string at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:901:3

Please help me with this.

skmvasu avatar Dec 06 '13 11:12 skmvasu

Seems to be related to this commit: https://github.com/nodeapps/http-server/commit/60c681ce4855e53a4657afe86035674fed1a948a

Missing comma at the end of the --cors option line.

meandmycode avatar Dec 06 '13 13:12 meandmycode

This is happening at my end as well.

" --cors Enable CORS via the 'Access-Control-Allow-Origin' header"

should be

" --cors Enable CORS via the 'Access-Control-Allow-Origin' header",

arniarent avatar Dec 06 '13 13:12 arniarent

i get the same error

askehansen avatar Dec 06 '13 15:12 askehansen

I get this same error, unable to run.

Fresh install of node v0.10.22 on osx

juddflamm avatar Dec 06 '13 17:12 juddflamm

open lib/node_modules/http-server/bin/http-server in a text editor; and add a the missing comma at the end of

"  --cors             Enable CORS via the 'Access-Control-Allow-Origin' header"
that will fix your problem

el-med avatar Dec 06 '13 17:12 el-med

Thank you; fixed the problem.

Great project!

juddflamm avatar Dec 06 '13 19:12 juddflamm

Fixed in 0.6.1

indexzero avatar Dec 11 '13 00:12 indexzero