Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Transpiling with Standalone Babel CLI

Jeff Chiu
Jeff Chiu
465 Points

error in terminal: webpack is not found

I have problem following through the lesson on webpack lesson I run the command in my terminal (zsh) npm run build

I copy my commands and the return error message after I type in my terminal: āžœ babel-workshop git:(webpack-lesson) āœ— npm run build

treehouse-babel-template@0.0.1 build /Users/jchiu/Desktop/javascript/babel-workshop webpack

sh: webpack: command not found

npm ERR! Darwin 16.1.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build" npm ERR! node v4.4.3 npm ERR! npm v2.15.1 npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! treehouse-babel-template@0.0.1 build: webpack npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the treehouse-babel-template@0.0.1 build script 'webpack'. npm ERR! This is most likely a problem with the treehouse-babel-template package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! webpack npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs treehouse-babel-template npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm ERR! npm owner ls treehouse-babel-template npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request: npm ERR! /Users/jchiu/Desktop/javascript/babel-workshop/npm-debug.log āžœ babel-workshop git:(webpack-lesson) āœ—

Please help me to resolve this issue

Jeff Chiu
Jeff Chiu
465 Points

I also followed the tutorial and input the build script into my package.json

{ "name": "treehouse-babel-template", "version": "0.0.1", "description": "Project template for \"Getting Started with Babel and ES2015\" on Treehouse.", "scripts": { "build": "babel src -d build"
}, "homepage": "https://github.com/treehouse/Babel_IsaacLeeMorris" }

I'm pretty sure there's no typo "babel src -d build"

I'm not sure why build script is not running.