Nerds-Who-Code / Mental-Health-Tracker

mental-health-tracker.vercel.app
MIT License
6 stars 6 forks source link

npm install can't install dependencies (server) (development branch) #68

Open xintamosaik opened 2 years ago

xintamosaik commented 2 years ago

Describe the bug npm install can't install dependencies (server)

To Reproduce Steps to reproduce the behavior:

  1. cd server
  2. npm install
  3. the error is shown in the screenshot

Expected behavior to install dependencies

Screenshots npm_install_server_err

Additional context Ubuntu 22.04

steph-koopmanschap commented 2 years ago

I believe required: {node: >= 14.0} Means you need to update your nodejs from v12 to v14 or higher you type node -v you can see your version. My node version is 18

Are you using Ubuntu LTS (Long Term Support)? LTS versions are more stable, but the downside is that you get very old software packages. LTS versions are not so good for coding and development, its more suited for regular desktop or production servers. node version 12 is from 2019 for example and is no longer supported as of april 2022.

You can either use sudo apt-get install --only-upgrade nodejs Or

sudo apt-get remove nodejs
curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -
sudo apt-get install nodejs

You can also try sudo apt update && sudo apt upgrade

If the above does not work try searching "How to update nodejs on ubuntu"

I hope this solves it. If not report back your results.

For latest nodejs releases See: https://nodejs.org/en/download/releases/

Also Ubuntu 22.10 has recently been released so you may want to also just upgrade your entire OS.