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
tree
OS X, LinuxNote: On Linux and OSX machines you can use
tree
to view the directory structure.
Instructions
Assuming you followed previous sections, you should currently be using npm3. Switch to npm2.
Create a
Exercise1
directory (mkdir Exercise1
), and thencd
into that directory and create 2 directories,npm2
andnpm3
.Change into the
npm2
directory. Run these commands:npm install mod-a@1.0 npm install mod-b@1.0
View the
node_modules
directory.Change intro the
npm3
directory. Switch to npm3.Run the same commands as listed in Step #3.
Compare and contrast the
npm3/node_modules
directory with thenpm2/node_modules
directory. Note the differences.