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.
My directory structure looks like this:
-lib(contains board.js, game.js, minesweeper.js)
-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! firstname.lastname@example.org build:
babel src -d lib
npm ERR! spawn ENOENT
npm ERR! Failed at the email@example.com 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?