Exercise 3: Debugging Missing Packages

Learning Objectives

  • recognize the error message when your program is missing a package
  • be able to fix the error by installing the necessary package

Prerequisites

  • you should have Node.js >= v4 installed
  • you should have npm v2 or v3 installed

Instructions

  1. Create a directory called exercise3
  2. Change into that directory using cd exercise3
  3. Create a file called index.js
  4. Cut and paste this code into index.js:

    var _ =  require('lodash');
    
  5. Run your program.
  6. Fix the error!

Hints

  • You can run a Node.js program by typing node <js-file-name where js-file-name is the name of a .js file, e.g. index, index.js

results matching ""

    No results matching ""