LearningWebAppDev
LearningWebAppDev copied to clipboard
pg 201, second printing, forgot to mention 'npm install express@3'
Gregory Hill writes:
On page 201 you have:
We can copy this file (server.js) into our Twitter directory (the same one that contains tweet_counter.js) and then modify it so that it imports our tweet counter module and uses the counts that we’ve exported.
However once I have done this and run the server I get the following error:
module.js:340 throw err; ^ Error: Cannot find module 'express' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at require (module.js:380:17) at Object.
(/home/vagrant/app/Twitter/server.js:1:77) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) This is because at no point does the book say to copy/install the express module into app/Twitter/node_modules. At this point in the book we only have:
vagrant@precise32:~/app/Twitter/node_modules$ ls ntwitter
Added official errata for this here: http://learningwebappdev.com/errata/chapter6/2015/03/29/forgot-to-install-express.html
On a newer Vagrant VirtualBox, the following was needed: npm install express@3 --no-bin-links