The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".
The following errata were submitted by our customers and approved as valid errors by the author or editor.
| Version |
Location |
Description |
Submitted By |
Date Submitted |
Date Corrected |
| PDF |
Page p14
United Kingdom |
1. Installed on Fedora.
node isn't visible on the cmd line (not on $PATH).
2. Installed from source ( built same version as author)
then add to PATH.
3. Biggy... if you're as daft as me.
If you run. e.g.
$node ex13.js &
then you need to kill it before you can run another program?
Otherwise you get
events.js:48
throw arguments[1]; // Unhandled 'error' event
^
Error: listen EADDRINUSE
at errnoException (net.js:670:11)
at Array.0 (net.js:771:26)
at EventEmitter._tickCallback (node.js:190:38)
$ ps -ef | grep node
will find the task.
HTH
Note from the Author or Editor: Thanks for note on Fedora. One of the interesting challenges associated with Node is the fact that installations across the various flavors of Unix differ.
Thanks also for the heads up on me needing to remind folks they can't run two instances of a Node application on the same port at the same time. When copy edit comes around, I'll insert a note warning folks.
|
Dave Pawson |
Jun 16, 2012 |
|
| PDF |
Page 3
4th paragraph |
Not the following command on the page:
tar -zxf node-v0.8.2.tar.gz
That is followed by the sentence: You now have a directory labeled node-v0.6.18.
The version number cited in the sentence is older.
Note from the Author or Editor: On page 3, 4th paragraph, change reference to node-v0.6.18 to node-v0.8.2.
|
tewarid |
Sep 21, 2012 |
|
| PDF |
Page 23
1st code snippet |
_ ++ doesn't increme as shown in the code. The value stays at 2, cause with post increment the value is first returned and increased after. _ += 1 or ++ _ would produce the expected output.
Note from the Author or Editor: On page 23, code snippet that reads
> a = 2;
2
> _ ++;
3
> _ ++;
4
Should be
> a = 2;
2
> ++_
3
> ++_
4
|
bekite |
Aug 22, 2012 |
|
| Safari Books Online |
36
section "global" |
All occurrences of "windows" should be replaced by "window", the proper name of the global object in a browser environment.
Note from the Author or Editor: Page 36, the global object is window, not windows. Change.
|
Thomas Corbière |
Sep 30, 2012 |
|
| Safari Books Online |
40
3rd encoding option |
"usc2" should be replaced by "ucs2".
Note from the Author or Editor: Page 40, change to ucs2
|
Thomas Corbière |
Sep 30, 2012 |
|
| Printed |
Page 41
Last line of code fragment at top of page |
In the setTimeOut function call, on_openAndReadFile should be the first function argument; there is no openAndReadFile function defined.
Note from the Author or Editor: In code snippet page 41, correct the last line of code to read
setTimeout(on_OpenAndReadFile, 2000, filename, res);
|
Anonymous |
Nov 19, 2012 |
|
| Safari Books Online |
59
8th paragraph |
The statement:
if (somecriteria) { en.emit('data'); }
has 2 typos. To be consistent with the rest of the text, it should be:
if (somecriteria) { em.emit('somevent''); }
^^^ ^^^^^^^^^^
Note from the Author or Editor: Page 59, snippet that reads
if (somecriteria) {
en.emit('data');
}
should read
if (somecriteria) {
em.emit('event');
}
|
Anonymous |
Mar 04, 2013 |
|
| Printed |
Page 64
bulleted list near the bottom of the page |
There appears to be a search missing from the list:
* /home/node_modules/mymodule.js
The missing search should be inserted between the following two items:
* /home/myname/node_modules/mymodule.js
* /node_modules/mymodule.js
Note from the Author or Editor: In list in middle of page 64, insert the line
/home/node_modules/mymodule.js
between
/home/myname/node_modules/mymodule.js
/node_modules/mymodule.js
|
Anonymous |
Nov 19, 2012 |
|
| Safari Books Online |
65
page top |
"delete require.cache('./circle.js');" should be replaced by "delete require.cache['/absolute/path/to/circle.js'];" as cache is an object and the keys are the absolute path of the loaded module.
Note from the Author or Editor: Change example on page 65 from
delete require.cache('./circle.js');
to
delete require.cache('/absolutepath/circle.js');
|
Thomas Corbière |
Sep 30, 2012 |
|
| PDF |
Page 83
Example 5-2 |
try {
test.doSomething('test', 3.55, function(err,value) {
if (err) throw err;
console.log(value);
});
} catch(err) {
console.error(err);
}
The line:
if (err) throw err;
will always throw an error for anything not false.
If you replace the second parameter 3.55 with a string ('this') as instructed, the first parameter will still be thrown and logged as an error. This can be verified by simply adding some text:
console.error("error is: ".red + err);
Note from the Author or Editor: Correct example 5-2 to replace the following line:
callback(arg1);
With the following:
callback(null, arg1);
|
Adrian Patino |
Nov 16, 2012 |
|
| Safari Books Online, Other Digital Version |
Page 83
Last paragraph |
The text says: "Example 5-2 is a complete Node application that creates an object with one method, someMethod", yet in the code example, the method is called "doSomething" not "someMethod".
Note from the Author or Editor: Change the reference to the literal from someMethod to doSomething on page 83.
|
Ariel Ortiz |
Mar 01, 2013 |
|
| ePub |
Page 85
Top |
Two errors in the process.nextTick example:
function asynchFunction = function (data, callback) {
process.nextTick(function() {
callback(val);
});
);
1. `function asynchFunction` should be `var asynchFunction`
2. `callback(val);` should be `callback(data);`
Note from the Author or Editor: In this code snippet, which I show in page 39 in Safari Online, change the code from
function asynchFunction = function (data, callback) {
process.nextTick(function() {
callback(val);
});
);
To
var asynchFunction = function (data, callback) {
process.nextTick(function() {
callback(data);
});
);
|
Noah J. Freitas |
Dec 22, 2012 |
|
| Safari Books Online |
88
page bottom |
"console.log('all finished');" should be changed to "console.log('all done');" to match the output example.
Note from the Author or Editor: page 88 change the text to all finished in code snippet
|
Thomas Corbière |
Sep 30, 2012 |
|
| Safari Books Online, Other Digital Version |
Page 105
First code snippet |
The first line of code is:
res.setHeader('Content-Type', 'test/html');
It should be "text" not "test":
res.setHeader('Content-Type', 'text/html');
Note from the Author or Editor: Change code snippet from
res.setHeader('Content-Type', 'test/html');
to
res.setHeader('Content-Type', 'text/html');
|
Ariel Ortiz |
Mar 01, 2013 |
|
| Safari Books Online |
130
sidebar "Setting the Application Mode" |
You should add the missing closing parentheses at the end of the two app.config() lines.
Note from the Author or Editor: Add a closing parenthesis to code snippets in sidebar that start with app.config.
|
Thomas Corbière |
Sep 30, 2012 |
|
| Safari Books Online |
208
section "Getting Started with MongoDB" |
You should remove the colon in front of the port number.
Note from the Author or Editor: Remove the colon in front of the 27017 in the code snippet.
|
Thomas Corbière |
Sep 30, 2012 |
|
| Safari Books Online |
243
allowNull description |
Shouldn't it be true to allow nulls instead of false?
Note from the Author or Editor: Page 243, section on allowNulls
Change to
true to allow nulls; true by default
|
Thomas Corbière |
Sep 30, 2012 |
|
| Safari Books Online |
252
1st bullet |
It reads "A form to select which PDF tool to upload" but I think you meant "A form to select which PDF document to upload", didn't you?
Note from the Author or Editor: Please change text on page 252 from
A form to select which PDF tool to upload
To
A form to select which PDF document to upload
|
Thomas Corbière |
Sep 30, 2012 |
|
| Safari Books Online |
266
Content-Range header format |
The required colon after the header name is missing. The correct format should be:
Content-Range: bytes 44040192-44062881/44062882
Note from the Author or Editor: Page 266 change snippet of code from
Content-Range bytes 44040192-44062881/44062882
To
Content-Range: bytes 44040192-44062881/44062882
|
Thomas Corbière |
Sep 30, 2012 |
|
| Safari Books Online |
299
warning section |
path.existsSync has been replaced by fs.existsSync not js.existsSync.
Note from the Author or Editor: Page 299, note, change js.existsSync to fs.existsSync
|
Thomas Corbière |
Sep 30, 2012 |
|
| Safari Books Online |
316
section titled "Setting Up TSL/SSL" |
The technology is named TLS not TSL. You should replace all occurences of TSL with TLS.
Note from the Author or Editor: Page 316, change TSL to TLS in page.
|
Thomas Corbière |
Sep 30, 2012 |
|
| PDF |
Page 329
line 14, example 15-4 |
Database name in USE statement inconsistent with previous USE statement.
passport.deserialiseUser() on p328 uses databasenm
passport.use() on p329 uses nodetest2
Note from the Author or Editor: Page 329, code line
client.query('USE nodetest2');
should read
client.query('USE databasenm');
|
Paul Bennett |
Dec 01, 2012 |
|
| Safari Books Online |
338
2nd line |
The content of the name string should be "'johnsmith'; drop table users" with johnsmith properly quoted as it is a string and not a column. Without quoting, the first statement would fail and in some environment (e.g. PHP with PDO), the second statement would not be executed and the attack would be unsuccessful.
Note from the Author or Editor: Change line to
'johnsmith"; drop table users'
|
Thomas Corbière |
Sep 30, 2012 |
|