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

Development Tools

Taulant Sulko
Taulant Sulko
5,633 Points

Webpack: Getting an error log when executing "npm run build" after including the babel loader

I followed the instructions on the video to get the Babel loader working with Webpack.

The error log mentions something about an unknown property "loaders". See the full log for more details.

taulantsulko [babel-workshop] (webpack-lesson)$ npm run build

> treehouse-babel-template@0.0.1 build /Users/taulantsulko/Projects/babel-workshop
> webpack

One CLI for webpack must be installed. These are recommended choices, delivered as separate packages:
 - webpack-cli (https://github.com/webpack/webpack-cli)
   The original webpack full-featured CLI.
We will use "npm" to install the CLI via "npm install -D".
Do you want to install 'webpack-cli' (yes/no): yes
Installing 'webpack-cli' (running 'npm install -D webpack-cli')...
npm WARN babel-loader@8.0.5 requires a peer of @babel/core@^7.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN treehouse-babel-template@0.0.1 No repository field.
npm WARN treehouse-babel-template@0.0.1 No license field.

+ webpack-cli@3.3.0
added 64 packages in 6.894s
Invalid configuration object. Webpack has been initialised using a configuration object that does not match the API schema.
 - configuration.module has an unknown property 'loaders'. These properties are valid:
   object { defaultRules?, exprContextCritical?, exprContextRecursive?, exprContextRegExp?, exprContextRequest?, noParse?, rules?, strictExportPresence?, strictThisContextOnImports?, unknownContextCritical?, unknownContextRecursive?, unknownContextRegExp?, unknownContextRequest?, unsafeCache?, wrappedContextCritical?, wrappedContextRecursive?, wrappedContextRegExp? }
   -> Options affecting the normal modules (`NormalModuleFactory`).
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! treehouse-babel-template@0.0.1 build: `webpack`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the treehouse-babel-template@0.0.1 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/taulantsulko/.npm/_logs/2019-03-25T18_46_05_084Z-debug.log
taulantsulko [babel-workshop] (webpack-lesson)$