"Yesterday it worked.
Today, it is not working.
Windows is like that."
— GNU Joke Haiku error messages [1]
A number of weeks ago, I Installed node.js and npm on my computer, using the official repository packages for Ubuntu (Plucky Puffin). I then proceeded to learn Node with the aim of creating an Uber clone (both app and API server) as part of a freelancing gig.
I made a departure to learn the new features of ES6+, which took a couple of weeks at least. Now, I have returned to the book on Node, only to find that there's an issue with NPM: I can install Node packages (such as Express and EJS) from the Ubuntu repository, but not locally within the project (using package.json and npm install). For some reason, I get the "command not found" error for NPM, even though npm -v returns a version number. I've tried uninstalling and reinstalling node, NPM and the modules the project uses. For some reason, the project can't find the modules installed from the Ubuntu repo, instead looking at what's in the local node_modules directory. WTF is going on here? I don't have time for this to play silly buggers! It worked a couple of weeks ago, so why not now?
IMO, the thing with JS is that when it works, it can be a thing of beauty, but when it breaks, it can be a real bugger to fix (often taking a few hours at a time).
I should have known it would be best to stick with that with which I'm already familiar, instead of trying to learn some newfangled tech stack. What a waste of my time. Urgh! (Thankfully, there's no time limit on this project, so the time I wasted hopefully won't count against me.) I'm going back to using PHP for the server-side API component and Java for the driver and user apps. (As much as I loathe Java, I at least know it. Surely mobile development with it can't be too hard ...) I've already found a repo that contains the code for these components. All I have to do to get it working is change a few strings (URLs and API keys), apparently.
Before I do that, though, I should probably finish/restart learning PHP 8. I'll probably have to go back to the YT video series [2] as I don't think I've got the downloaded versions any more, nor the playlist download software I used to get them.
Ho-hum, FML!