Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I am attempting to get a better understanding of nodejs so that I can get an IntelliJ plugin working.

I have installed NodeJS on my Windows 7 machine and verified that it works from the command line (node, then did a 2+2 it answered 4).

I then git cloned the AngularJS Seed project (https://github.com/angular/angular-seed) and proceeded to get that running (npm install, npm start) and all was good.

But then I tried using node to directly kick off the http-server module with the following command line from the AngularJS source directory.

node node_modules\.bin\http-server -a localhost -p 8000

and

node node_modules\.bin\http-server.cmd -a localhost -p 8000

Both commands give me the following error -

SyntaxError: Unexpected token ILLEGAL 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:906:3

Am I missing something easy here since I am new to NodeJS or am I doing something wrong?

share|improve this question

1 Answer 1

If you want to run http-server directly, you should install it globally:

npm install http-server -g

Then you can run the following:

http-server -a localhost -p 8000
share|improve this answer
    
You could explain what the error message means, and how your solution solves that... –  ericbn 10 hours ago

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.