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 trialJoseph Butler
Courses Plus Student 81 PointsOnly specific versions of express and body-parser work
As mentioned in this video i did not use the version number, rather just used
npm install express npm install body-parser
Everytime i use the routes it says Cannot /GET or /POST.
But when i install express 4.13 it works out fine. Why so? Same goes with body-parser. Post works only when using 1.15 version
2 Answers
Zack Jackson
30,220 PointsNewer versions of express come with body-parser built in so it is no longer necessary to install the separate package for parsing unless youβre working with older code or for a video on here.
Tobiasz Gala
Full Stack JavaScript Techdegree Student 23,529 PointsTo be more specific instead of using body-parser module you can simply type express.json()