When opening a cloned git project, Package manager tries to import wrong packages and fails

Hi,
I’m trying to open and build a project I cloned from a git repo.
When opening the project as unity is importing the packages I get a ton of “directory not found” errors.

The weird part is that the packages it is trying to import are not used in the project and are not even in the manifest.json it looks like it is using a manifest from somewhere else. For example, it is trying to import the com.unity.nuget.newtonsoft.json package, while that’s 100% not a package that’s being used in the project I cloned.

This is the manifest.json:

{
  "dependencies": {
    "com.unity.2d.sprite": "1.0.0",
    "com.unity.addressables": "1.18.19",
    "com.unity.collab-proxy": "1.13.5",
    "com.unity.ide.rider": "2.0.7",
    "com.unity.ide.visualstudio": "2.0.12",
    "com.unity.ide.vscode": "1.2.4",
    "com.unity.postprocessing": "3.1.1",
    "com.unity.test-framework": "1.1.30",
    "com.unity.textmeshpro": "3.0.6",
    "com.unity.timeline": "1.4.8",
    "com.unity.ugui": "1.0.0",
    "com.unity.modules.ai": "1.0.0",
    "com.unity.modules.androidjni": "1.0.0",
    "com.unity.modules.animation": "1.0.0",
    "com.unity.modules.assetbundle": "1.0.0",
    "com.unity.modules.audio": "1.0.0",
    "com.unity.modules.cloth": "1.0.0",
    "com.unity.modules.director": "1.0.0",
    "com.unity.modules.imageconversion": "1.0.0",
    "com.unity.modules.imgui": "1.0.0",
    "com.unity.modules.jsonserialize": "1.0.0",
    "com.unity.modules.particlesystem": "1.0.0",
    "com.unity.modules.physics": "1.0.0",
    "com.unity.modules.physics2d": "1.0.0",
    "com.unity.modules.screencapture": "1.0.0",
    "com.unity.modules.terrain": "1.0.0",
    "com.unity.modules.terrainphysics": "1.0.0",
    "com.unity.modules.tilemap": "1.0.0",
    "com.unity.modules.ui": "1.0.0",
    "com.unity.modules.uielements": "1.0.0",
    "com.unity.modules.umbra": "1.0.0",
    "com.unity.modules.unityanalytics": "1.0.0",
    "com.unity.modules.unitywebrequest": "1.0.0",
    "com.unity.modules.unitywebrequestassetbundle": "1.0.0",
    "com.unity.modules.unitywebrequestaudio": "1.0.0",
    "com.unity.modules.unitywebrequesttexture": "1.0.0",
    "com.unity.modules.unitywebrequestwww": "1.0.0",
    "com.unity.modules.vehicles": "1.0.0",
    "com.unity.modules.video": "1.0.0",
    "com.unity.modules.vr": "1.0.0",
    "com.unity.modules.wind": "1.0.0",
    "com.unity.modules.xr": "1.0.0"
  }
}

I tried right click + re-import the package folder, but it does the same stuff.

There’s a bunch of folders in the “packages” folder in my project view, corresponding to those packages it’s trying to import. When I select the package.json file in any of those folders, I get “Invalid Package Manifest” in the inspector.

7700836--964396--Screenshot 2021-12-01 at 14.24.58.png

In the solution explorer in Rider, I can see those folders as “read only”. The package.json files look normal.
7700836--964399--Screenshot 2021-12-01 at 14.24.43.png

I have no idea what’s going on

Ok, I finally solved the problem. As it turns out, it’s because there was an accent in one of my parent folders.