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 trialVang Nguyen
429 PointsThe lesson doesn't build or start the webpack-dev-server
An instructor needs to give clear and instructions on getting the project bulding and webpack-dev-server starting. I've followed through the confusing amount of suggestions on in the questions section and nothing has worked. Is this the reality of working with nodejs, a nightmare of dependency conflicts and searching for compatible packages.
2 Answers
Simon Olsen
3,597 PointsI have also followed lots of suggestions in the Questions here and nothing is working. I'm at a point where, if I install the latest webpack...
$ npm install --save-dev webpack@latest
npm WARN babel-loader@6.4.1 requires a peer of webpack@1 || 2 || ^2.1.0-beta || ^2.2.0-rc but none is installed. You must install peer dependencies yourself.
npm WARN html-webpack-plugin@2.30.1 requires a peer of webpack@1 || ^2 || ^2.1.0-beta || ^2.2.0-rc || ^3 but none is installed. You must install peer dependencies yourself.
npm WARN sass-loader@4.1.1 requires a peer of webpack@^2 || ^2.2.0-rc.0 || ^2.1.0-beta || ^1.12.6 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-treehouse-example@0.0.1 No repository field.
npm WARN webpack-treehouse-example@0.0.1 No license field.
+ webpack@4.8.3
added 56 packages from 62 contributors, removed 32 packages, updated 3 packages and audited 18787 packages in 17.338s
found 0 vulnerabilities
...so I read this that I need Webpack ^2, but when I install that...
$ npm install --save-dev webpack@^2
npm WARN webpack-cli@2.1.4 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-middleware@3.1.3 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-dev-server@3.1.4 requires a peer of webpack@^4.0.0-beta.1 but none is installed. You must install peer dependencies yourself.
npm WARN webpack-treehouse-example@0.0.1 No repository field.
npm WARN webpack-treehouse-example@0.0.1 No license field.
+ webpack@2.7.0
added 31 packages from 82 contributors, removed 59 packages, updated 4 packages and audited 17190 packages in 10.502s
found 0 vulnerabilities
...so no luck either way.
I've got the path
module installed and webpack.config.js
updated, as per Craig Curtis' instructions, I've also removed loaders:
in favour of rules:
as per Brian Cortes' post.
I've dealt with the mode: production issue by adding the following to webpack.config.js
mode: "development",
And npm start
STILL doesn't work...
It's pretty clear from all the questions/comments on this video that the dependencies need to be updated. Yes, npm modules get regular (read: daily!) updates, but this lesson simply can't be completed.
I'm not suggesting the videos be re-recorded, but SURELY the git repo can be updated so this lesson's project files actually work! This is no freeby tutorial on YouTube - we're forking out, monthly, for these courses.
Joel Jordan
Courses Plus Student 6,561 PointsI ended up uninstalling the webpack-dev-server and running the npm install --save-dev webpack-dev-server@1.13.0 and that did the trick. I noticed in lesson 03 the webpack-dev-server version under "devDependencies" was 1.13.1. When I tried to load that I got an error and when I ran the "npm view webpack-dev-server versions" command it showed there was no 1.13.1 so I installed 1.13.0 and that did the trick.
Tyler Lowrey
14,538 PointsThis fixed it for me, thanks!
Chloe Fusselman
218 PointsThis also worked for me. Thanks!