Possibly related, two issues. "Cannot read properties of undefined (reading 'envs')"

Things were working on an older laptop. But I just had to upgrade. I think the Windows install (I hate Windows) played a practical joke on me by giving me the user name “BANANAStein”. So my user dir is c:\Users\BANAN, which is A) stupid and B) on a small partition. So I installed everything on D: drive and created a “Personal” Folder there. (And yes, I have absolutely no idea where it came up with that and didn’t notice it until it was mostly done with the install)

So, how do I point everything in PIO to “d:\Personal…”?

And when I created a new project, it gives the error “Cannot read properties of undefined (reading ‘envs’)”

Which I suspect is related to the same issue, but can’t be sure because I don’t know what the heck that error actually means.
I know that there is an #include file that is not being found. I fixed the path, pointed it in the right direction. But for some reason, the files in “lost” include file (extra #includes) are also not found.

So it seems to keep trying to point to c:\users\BANN no matter what. Not the “d:\personal” I’d like to use.

If I compile an old project, it seems to work OK. It’s just a new project, using a different platform, not Arduino (8266 RTOS).

You can set the environment variable PLATFORMIO_CORE_DIR and let it point to D:\Personal\.platformio

  • Create the environment variable and set it to D:\Personal\.platformio
  • Start VS Code
  • Open a PlatformIO project
  • Wait until all installation tasks have been finished

Check if this still happens after changing the platformio directory.

Thanks! That would have to be in every project .ini file? Or is there a main file I can put that in?

I’ll have to try it and see, the code I was working with is no longer around. It was just a sample project, and I can’t seem to recreate or find that sample project.

No, just set a Windows environment variable “PLATFORMIO_CORE_DIR”.
This will apply to all your projects.

Got, thanks. I figured there must be something like that, but I was looking in PIO, not external variables.

1 Like

Do you know, can I do this with .vscode also? That also takes up much room.

I think the portable mode can solve this issue.