Babelrc for last stage of Minesweeper project

I finished part 5 of the Minesweeper project successfully and followed the instructions for how to set up a .babelrc file to transpile to ES5, but when I run my code the “lib” directory just contains the same ES6 code I wrote and my terminal won’t run it because the “import/export” terminology is ES6.

https://www.codecademy.com/programs/6a4de1264e49b3e0a75e7e1bf9398ecd/content-items/f82c93966b8dba33a7cacbce52575464

My directory structure looks like this:
minesweeper
-lib(contains board.js, game.js, minesweeper.js)
-node_modules
-src (contains board.js, game.js, minesweeper.js, ms.babelrc, package-lock.json, and package.json)

Once I made sure my directory structure looked like that I ran “npm run build” again and got this error message:
sh: babel: command not found

npm ERR! file sh

npm ERR! code ELIFECYCLE

npm ERR! errno ENOENT

npm ERR! syscall spawn

npm ERR! [email protected] build: babel src -d lib

npm ERR! spawn ENOENT

npm ERR!

npm ERR! Failed at the [email protected] build script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm WARN Local package.json exists, but node_modules missing, did you mean to install?