1

I'm trying to follow the Angular tutorial and I can't pass step 00 part 2. I used node.js and try to run the command scripts/web-server.js. It just shows me "..." and when I go to the local host port 8000 it says couldn't connect.

any ideas?

7
  • If that script runs correctly, it prints "Http Server running at localhost:8000" to the terminal. Which version of node do you have? Commented Oct 20, 2013 at 8:15
  • 3
    Despite your reference to this tutorial, please show us what your code looks like and how you call it. Commented Oct 20, 2013 at 8:15
  • @ksimons I used the latest version which is 10.20 Commented Oct 20, 2013 at 8:31
  • @luksch I didn't use any code as of yet, i assume the web-server.js is already made somewhere Commented Oct 20, 2013 at 8:33
  • So from the root of the angular-phonecat directory you type node ./scripts/web-server.js and it doesn't work? Commented Oct 20, 2013 at 8:46

3 Answers 3

3

You just need to:

git clone git://github.com/angular/angular-phonecat.git
cd angular-phonecat
node ./scripts/web-server.js
Sign up to request clarification or add additional context in comments.

4 Comments

yeah did exactly that, it gave me a module error module.js:340 throw err; ^ Error: Cannot find module 'C:\Program Files (x86)\Git\scripts\web-server.js' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:901:3
Are you sure you're typing it exactly as above? I've just tried it on Windows as well and it works perfectly. Just do it in a normal Windows command prompt.
AH I just for the "." before the /script and it work perfectly now thank you
What worked and didnt for me: Worked: added the angular-phonecat directory using the tutorial, with git clone --depth=14 github.com/angular/angular-phonecat.git Didn't work:the git command above (in a different directory):fatal: unable to connect to github.com Didn't work: the node command "node ./scripts/web-server.js" (even copy/pasting, with "." included. Error message as described 3 comments above by user2809321 BTW Do I really need to get node.js working in order to use angular.js? Other tutorials out there just include a link to the library on Google
0

So the URL you are meant to enter into the browser is actually http://localhost:8000/angular-phonecat/app/index.html

It depends on the directory you are in, if you just put: http://localhost:8000 in you will be able to navigate to the directory and open the index.html graphically.

Comments

0

Go to http://docs.angularjs.org/tutorial and follow the steps there. Specifically do the following - In command prompt navigate to your solution directory - i.e. Users\"<>"\angular-phonecat and run

npm install

This command will download the following tools, into the node_modules directive:

Bower - client-side code package manager

http-server - simple local static web server

Karma - unit test runner

protractor - end 2 end test runner

and then run the following command -

npm start

and now you should be able to navigate to localhost:8000/app/index.html on your browser !

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.