Question

I'm in the directory /backbone/ which has a main.js file within scripts. I run python -m SimpleHTTPServer from the backbone directory and display it in the browser and the console reads the error $ is not defined and references a completely different main.js file from something I was working on days ago with a local python server.

I am new to this and don't have an idea what's going on. Would love some suggestions if you have time.

Was it helpful?

Solution 2

Only one process can listen on a port; you cannot have two SimpleHTTPServer processes listening on the same port. You can however leave an old server process up and then disregard failed startup of the new server process or error message about automatic port conflict resolution.

To debug this process, use netstat ( lsof in OSX, since BSD netstat is lame ) to find the process listening on the port and then 'ps -fww' to list data about that process. You can also take a look at /proc/$pid ( linux ) to get a process ID's current working directories. lsof can also help track down files the process has open in linux OR BSD/OSX if you're unsure which files it's serving.

Hope it helps!

OTHER TIPS

I recently had this problem and it was due to the old page being stored in the browser cache. Accessing the port from a different browser worked for me (or you can clear your cache).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top