secretOrPrivateKey must have a value
In my case, I have this folder structure.
Project
frontend
backend
- index.js
- .env
I ran into the error "secretOrPrivateKey must have a value" because the terminal was in Project
folder and I ran nodemon backend/index.js
. I wasn't in the correct folder with .env file to run the backend. cd backend && nodemon index.js
helps