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 Build a REST API With Express Building API Routes in Express Building the Question Routes

Only 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
Zack Jackson
30,220 Points

Newer 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.