small medium large xlarge

Errata for Node.js the Right Way

 

The latest version of the book is P1.0, released over 2 years ago. If you've bought a PDF of the book and would like to upgrade it to this version (for free), visit your home page.

By default this page displays the errata for the latest version of the book. If you have a previous version, select it here:

If you've found a new error, please submit it.

  • Typo
  • Tech. error
  • Suggestion
  • Maybe next edition
  • Not a problem
  • Reported in: P1.0 (30-Nov-14)
#77869
Paper page: 1
In the files that were setup to be executable (using chmod), the shebang line #!/usr/bin/env node --harmony is likely to work only on a Mac. It appear...more...
  • Reported in: P1.0 (13-Oct-14)
#77630
PDF page: 1
the book is great, thank you. i want to note something here about all the code you wrote in the book. as developer that come from other languages and...more...
  • Reported in: P1.0 (02-Jan-14)
#58787
PDF page: 5

I try with a linux distro and there is no 'close' event sent. 'exit' event works--David

  • Reported in: P1.0 (14-May-15)
#78438
Paper page: 15
Jim, I'm enjoying your book. I find your writing style easy to follow. So thanks. Being new to Node, it took some digging to find valid events to...more...
  • Reported in: P1.0 (04-Mar-14)
#76474
Paper page: 15
The code as shown shouldn't work; the variable "output" has the wrong scope. The quick fix is to change the comma on the proceeding line to a semicol...more...
  • Reported in: P1.0 (04-Mar-14)
#76475
Paper page: 15
The number of fields produces by the ls command depend on the locale (if POSIX ls is used). The file's name may be the 8th, 9th, or another field. ...more...
  • Reported in: P1.0 (04-Mar-14)
#76476
Paper page: 15

My bad, please ignore #76474; I had the blocks not nested when I looked. I looked again; should have done that before posting.
--Wayne Pollock

  • Reported in: P1.0 (14-Aug-14)
#77212
PDF page: 16
(Loc 172 in Kindle) As an FYI (knowing that you can't account for all *nix distros), on Ubuntu 14.04 node is named 'nodejs' the shebang is "#!/usr/bin...more...
  • Reported in: P1.0 (20-Nov-13)
#53188
PDF page: 16
Strings and regexes in the code samples are italicized. Unfortunately, italicizing a backslash makes it look a lot like a pipe symbol. I suggest using...more...
  • Reported in: P1.0 (08-Dec-13)
#53313
PDF page: 18
Shebangs with more than one argument don't work as expected on Linux, so the example doesn't work directly on all "Unix-like systems". A note about th...more...
  • Reported in: P1.0 (22-Mar-15)
#78272
PDF page: 18
In read-stream.js the 'data' event handler needs to be added AFTER the 'error' event handler - currently adding the 'data' event handler will switch t...more...
  • Reported in: P1.0 (22-Sep-15)
#78841
Paper page: 18
You can make executable node.js scripts on linux for example: #!/home/jda2000/.nvm/versions/node/v4.1.0/bin/node --harmony "use strict"; let i = ...more...
  • Reported in: P1.0 (01-Dec-13)
#53257
PDF page: 25
On the code example, the Date.now() method is used, which returns the number of seconds since 1 January 1970 00:00:00 UTC. However, on the description...more...
  • Reported in: P1.0 (24-May-14)
#76815
PDF page: 25
Not really an error, but be mindful of any other services you have listening on this port. Postgres.app uses 5432 as well. Node doesn't throw an error...more...
  • Reported in: P1.0 (13-Jun-14)
#76858
Paper page: 25
In the code for the net-watcher.js file in the "watcher setup" section the code reads: 'let watcher = fs.watch(filename, function(){ connection....more...
  • Reported in: P1.0 (27-Apr-14)
#76729
Paper page: 25
On page 27 we read that the expected output of the net-watcher.js script described on pages 25 and 26 is: File 'target.txt' changed: Sat Jan 12...more...
  • Reported in: P1.0 (22-Feb-14)
#76446
PDF page: 26

Postgres often runs on port 5432. This can cause confusion when using telnet. Perhaps use another high port like 8124 from the node docs.--Mark

  • Reported in: P1.0 (23-Sep-15)
#78842
Paper page: 27

It seems on Ubuntu 14.04 you have to use Ctrl-]quit to exit telnet Ctrl-]Ctrl-C seems to be ignored.

  • Reported in: P1.0 (04-Dec-13)
#53277
PDF page: 28
I'm a windows user, so instead of using telnet, I use netcat. and instead of using the windows command prompt, I use git bash since it provides me wi...more...
  • Reported in: P1.0 (13-Jun-14)
#76859
Paper page: 30
When changing the code to the call of "connection.write" as suggested on page 30, the same error occurs when using the Date.now() object as was used o...more...
  • Reported in: P1.0 (03-Dec-13)
#53270
PDF page: 40
(I'm looking at the ePub version, not the PDF.) In the code for the watcher-spawn-parse.js, as rendered in my ePub, I do not see the forward-slashe...more...
  • Reported in: P1.0 (30-Nov-13)
#53253
PDF page: 45
You are using publisher.bind when binding to the port. I had an issue where I had a typo that caused the server to exit and I could no longer bind to ...more...
  • Reported in: P1.0 (04-Dec-13)
#53278
PDF page: 49

getting errors when trying to execute the ldj.js file, had to convert all let to var.

  • Reported in: P1.0 (29-May-16)
#80371
Paper page: 51
In running the loop version of the zqm-filer script, I'm issuing three requests in the loop, as per instructions, but only getting one response. ...more...
  • Reported in: P1.0 (28-Mar-14)
#76573
PDF page: 57
Maybe you should handle errors when binding router and dealer? I've had a permission error when trying to bind the ipc endpoint. It took me about a...more...
  • Reported in: P1.0 (06-Dec-13)
#53297
PDF page: 57
Based on book example received: TypeError: Array.prototype.slice called on null or undefined made following change to receive expected output: zm...more...
  • Reported in: P1.0 (28-Mar-14)
#76572
PDF page: 58
The last command on the page is missing the target file. Currently, it is printed as: "node --harmony zmq-filer-req-loop.js" To make it work, I ...more...
  • Reported in: P1.0 (07-Jun-16)
#80404
Paper page: 72
In addition to adding .get() for both subjects and authors as mentioned in #76602 (which in turn mentions enabling xmlMode in #76602, which I also use...more...
  • Reported in: P1.0 (22-Apr-15)
#78370
PDF page: 72
In pg132.json, authors should be: "authors": [ "Giles, Lionel", "Sunzi, active 6th century B.C." ...more...
  • Reported in: P1.0 (02-Apr-14)
#76602
PDF page: 72
On line 10 of rdf-parser.js, the code should be passing a second argument of { xmlMode: true } to cheerio.load(). Versions 0.13 and newer of cheeri...more...
  • Reported in: P1.0 (10-Feb-14)
#76396
PDF page: 72
In order to get the subjects out of The Art of War, I had to change the value of subjects to the following: $('pgterms\\:ebook dcterms\\:subject rdf\...more...
  • Reported in: P1.0 (21-Feb-14)
#76443
Paper page: 72
With the latest version of Cheerio the authors and subjects return a Cheerio array, not a plain array. It will not compare properly to the test JSON o...more...
  • Reported in: P1.0 (01-Jan-14)
#58781
Paper page: 72

The example code on page 72 breaks when using Cheerio 0.13.0 (latest). Cheerio 0.12.4 seems to work.--Aaron Breckenridge

  • Reported in: P1.0 (03-Jan-15)
#78009
PDF page: 72
In addition to enabling xmlMode mentioned in #76602, add the method .get() for both authors and subjects authors: $('pgterms\\:agent pgterms\\:nam...more...
  • Reported in: P1.0 (15-May-14)
#76796
PDF page: 75
I was unable to run the 'node --harmony $(which nodeunit) test/' command successfully on Windows 7. I ended up editing the %userprofile%\AppData\Roami...more...
  • Reported in: P1.0 (04-Dec-13)
#53279
PDF page: 79
After running "node --harmony import-books.js" the text suggests that there will be an ECONNRESET error. On my circa-2012 MacBook Pro, it ran without ...more...
  • Reported in: P1.0 (10-Jun-15)
#78479
Paper page: 80
When using the dbcli program from the command line to delete a document, you may need to encase the URL argument in quotes- ./dbcli.js DELETE books...more...
  • Reported in: P1.0 (04-Dec-13)
#53280
PDF page: 84
"If this is your first time running this program, there won’t be a _desing/books document yet and the request will return a 404 Not Found status code....more...
  • Reported in: P1.0 (05-Dec-13)
#53285
PDF page: 89
You should clarify that the reader should run "npm install" with no arguments to install dependencies declared in package.json. Previously in the book...more...
  • Reported in: P1.0 (27-Jun-14)
#76911
PDF page: 89
Error: Most middleware (like logger) is no longer bundled with Express and must be installed separately. I got this error with the newer version of ...more...
  • Reported in: P1.0 (05-Dec-13)
#53284
PDF page: 92
When I run "nodemon --harmony server.js" on the downloaded source code, I get the following error: /Users/bcbrown/node/ntrw/web-services/b4/lib/bun...more...
  • Reported in: P1.0 (05-Dec-13)
#53286
PDF page: 92
Using the downloaded code and a straight install of CouchDB (which has worked on all examples heretofore), I cannot get any of the search API examples...more...
  • Reported in: P1.0 (08-Dec-13)
#53314
PDF page: 92
The "module.exports = function" pattern appeared before, at page 72 (on the PDF). Maybe the explanation of what it is should be moved to its first ins...more...
  • Reported in: P1.0 (24-Jul-14)
#77044
Paper page: 98pp
Instead of " ... as a successful resolution of the promise and calls the second then's handler function..." it should read: " ... as a successful reso...more...
  • Reported in: P1.0 (29-Apr-16)
#80276
Paper page: 110
From the downloaded files, I am able to install and run redis-server, able to start server.js using npm start, start the couchdb (which was a major pa...more...
  • Reported in: P1.0 (09-Jan-15)
#78029
Paper page: 116
Using latest connect-redis, redis, express 3.3.8 and nodemon I was not able to produce the REDIS ECONNREFUSED error when killing the redis server usin...more...
  • Reported in: P1.0 (22-Nov-13)
#53198
PDF page: 119
Line 20 reads: Array.prototype.slice.call(null, arguments); should read: Array.prototype.slice.call(arguments); This same error is in other ...more...
  • Reported in: P1.0 (18-Oct-14)
#77663
PDF page: 130
most of express modules are not inside the Express module anymore. you have those in external modules. you need to set a comment about it because mos...more...
  • Reported in: P1.0 (27-Nov-13)
#53223
PDF page: 222

The many calls to yield in the file bundle.js need to be changed to Fiber.yield()--Mike Ratliff

  • Reported in: P1.0 (27-Nov-14)
#77850
PDF page: 1491
zmq-filer-rep-cluster.js, uses .bind('ipc://filer-dealer.ipc'); This does not work on my Ubuntu 14.04 (launched using Vagrant). This has to do with pe...more...
  • Reported in: P1.0 (13-Jan-16)
#79617
Paper page: 1864
To finally get the nodeunit test working in the section titled: "Unit Testing with Nodeunit" I needed to have this callback in rdf-parser.js. I al...more...
  • Reported in: P1.0 (29-Nov-14)
#77866
PDF page: 1869
The selector for subjects to not take into account that the rdf:value elements may be before or after the rdf:resource element. The "~" only gets the ...more...
  • Reported in: P1.0 (14-Jan-16)
#79626
Paper page: 2372
At the start of chapter six, when creating the hello server. Before installing express, run "npm init" and just press Enter when prompted multiple tim...more...
  • Reported in: P1.0 (14-Jan-16)
#79627
Paper page: 2436
When you start working on the b4 app in chapter 6, make sure you CD into the b4 directory and run npm install again, to get dependencies. The book doe...more...