I recently had to start over with my NextJS project after my MacBook was stolen. I've set up AuthJS and Prisma with MySQL in the original setup, but now I'm struggling to reinstall everything on my new MacBook Air with a fresh install of macOS. I've copied the project folder from my backup, but I'm hitting a wall when I try running 'npm install'. The error I'm encountering is 'npm error code ERESOLVE', which indicates issues with resolving the dependency tree—specifically, conflicts between 'next-auth' and its peer dependencies. What can I do to resolve these dependency issues? Is it wise to just delete conflicting lines in my package.json? Also, I'd love tips on the best practices for transferring my projects to a new PC.
3 Answers
You might be facing an npm version issue. In addition to what you're experiencing, using Git is the way to go. On a new machine, I just install VS Code, Node, and Git, and I'm good to go in no time.
Make sure you're using Git! It's essential for version control in development. It sounds like you would benefit from a full setup with GitHub. It could help avoid these kinds of dependency problems when transferring to a new PC since you'd be able to easily push your changes and pull them down elsewhere.
I’ve been avoiding GitHub since I work alone and have my backup system. But will it help me prevent these issues in the future?
It sounds like you might have copied the node_modules folder over. Try this: remove the node_modules directory and the package-lock.json file, clean the npm cache, and reinstall your packages. If you still have issues, check if you're on an outdated version of Node or if there are upstream dependency problems to resolve.
Thanks for the encouragement! Should I focus on getting my current setup working before I jump into Git?