I have worked my way successfully all the way to Chapter 5 without any problems.
However, now I can't get the Chapter 5 code to run. I at first was looking for something wrong in my transcription of the code from book to editor but when I attempted to run the code I downloaded from the website I failed as well.
To be specific I get:
The error occurs and crashes the page right away.Code:info - socket.io started http.js:708 throw new Error('Can\'t set headers after they are sent.'); ^ Error: Can't set headers after they are sent. at ServerResponse.OutgoingMessage.setHeader (http.js:708:11) at ServerResponse.res.setHeader (/home/puffjay/Sandbox/Node/chapter05/node_modules/express/node_modules/connect/lib/patch.js:62:20) at next (/home/puffjay/Sandbox/Node/chapter05/node_modules/express/node_modules/connect/lib/http.js:171:13) at /home/puffjay/Sandbox/Node/chapter05/node_modules/express/node_modules/connect/lib/middleware/static.js:150:11 at Object.oncomplete (fs.js:107:15)
From googling, it appears that this error is a bit of a tricky one to pin down.
Can anyone else confirm that they are getting the error?
When I run the demo code, I run "npm install" in the base chapter05 directory and after that completes, I run "node nockmarket.js" with my local mongodb instance running. I do receive some warnings during the npm install but most are simple complaints about a missing README.md file with these others:
OS: Arch LinuxCode:npm WARN engine hawk@0.10.2: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.2","npm":"1.2.15"}) npm WARN engine hoek@0.7.3: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.2","npm":"1.2.15"}) npm WARN engine sntp@0.1.4: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.2","npm":"1.2.15"}) npm WARN engine cryptiles@0.1.3: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.2","npm":"1.2.15"}) npm WARN engine boom@0.3.8: wanted: {"node":"0.8.x"} (current: {"node":"v0.10.2","npm":"1.2.15"}) npm WARN engine formidable@1.0.13: wanted: {"node":"<0.9.0"} (current: {"node":"v0.10.2","npm":"1.2.15"})
Are there any other details that may help get to the bottom of this mystery?


Reply With Quote
Bookmarks