Update lockfile patching for different versions (#36959)
Update lockfile patching for different versions (#36959)

This ensures different lockfile versions are handled and we skip patching when the version isn't supported. This also adds an env variable to allow skipping this check if desired. 

## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`

Closes: https://github.com/vercel/next.js/issues/36816
JeromeFitz/next.js,JeromeFitz/next.js,JeromeFitz/next.js,JeromeFitz/next.js