Boss Machine Project - Error When Running npm install

Hi.

I was getting an error on the Boss Machine project in the back-end engineering course. When trying to run the npm install after downloading the project, I kept getting errors. It seems like a common problem, but when I emailed Codecademy, they didn’t bother to get back to me.

Anyway, I have found a workaround for anyone else struggling with it:

instead of running npm install, run:

npm install --force

Once that has completed, it will require an audit. So, run:

npm audit fix --force

2 Likes

This worked for me !

Remember to add the following code to the end of server.js to actually start the server:

app.listen(PORT, () => {
  console.log(`Server is listening on port ${PORT}`);
});

Now the server start and you get the expected message in the terminal: Server listening to port 4001

1 Like

Your code worked for me. Thank you.

Just a heads up from November 2024 - the Boss Machine project still benefits from the --force option when running npm install, the first step in the project. I found that the install process halted with errors, otherwise.

It sounds like you’ve found a practical workaround for the npm install issue in the Boss Machine project! Using the --force flag with npm install and then running npm audit fix --force is a good way to resolve dependency issues that can sometimes occur, especially with conflicting or outdated packages.

Just be cautious when using --force, as it can sometimes bypass certain warnings and potentially introduce issues with dependencies. It’s great that you’ve shared this solution for others—hopefully, Codecademy updates the project setup to avoid this in the future!