I am in need of help when trying to follow the instructions as part of the pre-requisites for the MoT Foundation Course in Test Automation (JavaScript). I seem to have fallen at the first hurdle!
When I am following the instructions to run ‘npm install’ I am getting alot of warning errors:
I ran into the same thing with a coursework in Cypress elsewhere.
From what I understand “Audit” is the first level. “–force” is the next biggest hammer. I ran audit and it cleared up most of the stuff. Since I was running everything locally and not putting anything onto a production environment I didnt worry too awful much.
Others will almost certainly know more than I do. But thats my tidbit
Thanks in glad I’m not the only one … to be honest i did try running through the options of audit and audit fund and audit fix etc but the vulnerabilities just decreased and then increased. So i deleted the repo folder and re cloned the code from github to my local machine.
Welcome to the world of dependency management. You’ve done nothing wrong, and despite the scary message, the installation was successful.
What you are getting is a message, intended for the author or the project, that new versions of the dependencies need to be installed.
Out of date dependencies on training courses is very typical, as to keep up to date you need to be managing dependency versions at minimum every week, if not daily in some cases. A lot of work.
@mwinteringham who is managing the course content? Might be worth seeing if you can figure out a way to do some automatic upgrades, and add a note to the course notes?
A version manager can help you, especially if you need different versions for different projects. NVM I’m this case, and there is a guide here:
NVM makes it easier to install and run different versions of node.
Similar managers exist for Ruby and Java, Python and probably others. Some IDEs take care of these things for you, but it’s worth understanding what goes on underneath.
Note that still leaves you with dependency versions to control, these take care of the version of the core technology, e.g Node in this case.
Not smarter I assure you, just further down the road
of handling the pain of handling versions and dependencies, and especially following training courses for anything JavaScript.
@fullsnacktester pretty much hit the nail on the head. The warns you are seeing are because the libraries we are using are themselves relying on libraries that have potential issues. A warn is as it says, a warning, meaning that you would take it into consideration if you were, for example, deploying material publically. For the course you can ignore them as you will be running this code on your machine.
We have automated dependency management in place with dependabot and auto-committing. But we can’t respond to every change right away and it does require getting learners to pull and reinstall which can be a drag on learning. So I will need to consider pragmatic solution around advice.
Hey, I just thought I would add this in case it helps someone (especially the non-teccy and easily startled like myself ) - When I ran ‘npm start’ I got a fail because I needed to install java, even though I am doing the javascript course. So I just went ahead and installed java and it worked.
Maybe it is an issue that MoT would want to fix, or maybe just mention it in the prerequisites?
That’s a little unusual. I wouldn’t expect that you would need Java to make NodeJS work. Do you have any of the error details or any references you used still to hand for more detail?