CLion - PlatformIO build error

I’m trying to use CLion to write code for Arduino, and I’m getting this error whenever I try to build:

'platformio' is not recognized as an internal or external command,
operable program or batch file.
mingw32-make.exe[3]: *** [CMakeFiles\Production.dir\build.make:76: CMakeFiles/Production] Error 1
mingw32-make.exe[2]: *** [CMakeFiles\Makefile2:99: CMakeFiles/Production.dir/all] Error 2
mingw32-make.exe[1]: *** [CMakeFiles\Makefile2:106: CMakeFiles/Production.dir/rule] Error 2
mingw32-make.exe: *** [Makefile:137: Production] Error 2

I am sort of new to this so I’m not savvy when it comes to this stuff. Has anyone run into this before?

…MinGW make? You have installed the CLion PlatformIO extension, used that project wizard to create the project and are building using the “PlatformIO Upload” target and then the hammer icon, right?

Please once read through the CLion + PlatformIO documentation.

The plugin also requires you to install the PlatformIO core / CLI in such a way that the platformio command is globally accessible in the shell. This is explained in the FAQ and installation guide.

It looks like moving the line that I added to the system path variables to the top fixed this. Thanks!