Exercise 1: Changing versions of npm
Learning Objectives
- reliably switch between versions of npm
- compare and contrast npm2 and npm3
Prerequisites
- you should have Node.js >= v4 installed
- you should have npm v3 installed
(optional) install
treeOS X, LinuxNote: On Linux and OSX machines you can use
treeto view the directory structure.
Instructions
Assuming you followed previous sections, you should currently be using npm3. Switch to npm2.
Create a
Exercise1directory (mkdir Exercise1), and thencdinto that directory and create 2 directories,npm2andnpm3.Change into the
npm2directory. Run these commands:npm install mod-a@1.0 npm install mod-b@1.0View the
node_modulesdirectory.Change intro the
npm3directory. Switch to npm3.Run the same commands as listed in Step #3.
Compare and contrast the
npm3/node_modulesdirectory with thenpm2/node_modulesdirectory. Note the differences.