Free Code Camp has been a great help. And also a source of great frustration. Just like every other tutorial out there, it is affected by the rapid, constant changes in the JS Landscape.
The frustration comes when it seems impossible to get through a lesson with code that has been deprecated, obsoleted, or just doesn’t work.
One tip: Don’t add any extra ‘fluff’ to a course. The fewer things to break, the more likely your lesson will still be valid a month later.
Second tip: maybe set up an app that monitors all the FCC code in lessons and email the authors when there’s an error response. There’s a lot of material here, and it would be impossible to keep it all up to date without some automation and efficient use of contributors time.
Third: Create a script or Docker for a common, stable environment where everything works and where actual learning can occur. I’ve been trying to learn JS for a while, and every tutorial is different, introduces new bugs, creates another search of StackOverflow for 3 different solutions, all with other different packages that may or may not work, leading down 6 different rabbit holes of somebody elses code trying to get it to work.
Four: Put a date, setup, and version numbers on your tutorial. Overall, it seems the entire JS environment is in flux and nearly impossible to find tutorials that still work.
The Beta curriculum is indeed in flux, however the content should all work. And the curriculum does have integration testing. It would help if you could provide specific examples of lessons you believe have bugs so they can be verified and triaged.
After installing Express, go to the package.json file and include “type”: “module” . This declaration will tell Node that this project will be using ES6 module syntax (import/export) instead of common.js, which is the default in Node.
// Getting the list of users from the mock database
router.get('/', (req, res) => {
res.send(users); <<---------------------------------
})
export default router
What is this ‘users’ refering to? users.js, users.object, or users.endpoint? no idea.
I appreciate all the help. I have been stuck on this a week already.
I changed that back to const router = express.Router();
then:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package ‘express.router’ imported from C:\Users\Kermit\Documents\Dev\dev10\routes\users.js
Sounds like you’re programming real-world web apps.
Every problem has a solution and finding it is part of the thing. That’s what professional programmers are doing (that’s where all of the stackoverflow questions and answers come from. Professional programmers correct me if I’m wrong here).
If you learned in a closed simulator environment where everything went smoothly, versions never changed and nothing was ever updated and you never needed to consult documentation on what got updated and how to change it, you would not learn as much.
That said, if something gets too difficult or you cannot find a solution, someone in this forum will help you.
Thanks PK, glad I’m not alone. My problem is I get through 3-4 modules and none of them work, I feel like I haven’t learned much. Then I’m back to create-react-app and start over again. Oh, and they deprecated that too. (#@)(% lol
this will not work, as req and res if you write the callback correctly, are function parameters, they get a value from app.get when it calls the callback, not from outside variables
This is verbatim from the index.js in the lesson?
I think it’s included as the default root ‘/’ response. I’ll just remove it for now unless there’s a fix.