4

I sometimes want to switch my projects to use exact package versions.

Current:

"dependencies": {
  "firebase": "^9.6.2",
  "next": "12.0.7",
  "react": "17.0.2",
  "react-dom": "17.0.2",
  "react-firebase-hooks": "^4.0.2",
  "react-firebaseui": "^6.0.0"
}

Is it safe to simply remove the carets in front of the package names?

Or do I need to first uninstall these packages and reinstall specifying the exact version?

Nelu
  • 16,644
  • 10
  • 80
  • 88

1 Answers1

3

You should look for the installed version with npm list, then fix that version in the package.json. That way you won't be changing any versions.

Faber
  • 350
  • 6
  • 23