Page 1 of 1

build.ninja error from VSCode but works OK from terminal

Posted: Tue Feb 14, 2023 12:25 am
by geedotk
I have VS Code v1.75 and I've installed the Espressif IDF exension v1.5.1 on a Windows 11 machine

After configuring the ESP-IDF extension, I tried to build the hello world example. I get this Ninja error
Executing task: ninja

ninja: error: loading 'build.ninja': The system cannot find the file specified.

* The terminal process "C:\Program Files\PowerShell\7\pwsh.exe -Command ninja " terminated with exit code: 1.
If I go to the terminal, I can run "idf.py build" and it builds without a problem, but trying to do an "ESP-IDF: Build your project" from VSCode results in the ninja error.

Why can't I build from VSCode when the ESP-IDF seems to work fine from the terminal?

Re: build.ninja error from VSCode but works OK from terminal

Posted: Fri Feb 17, 2023 8:17 am
by ESP_bignacio
Seems there might be an issue with your configuration. Check the troubleshooting section and share the required information.

Re: build.ninja error from VSCode but works OK from terminal

Posted: Fri Feb 17, 2023 7:19 pm
by geedotk
I believe I figured out a solution; VSCode didn't seem to like the location of my PowerShell installation at "C:\Program Files\PowerShell\7\pwsh.exe". It probably had to do with the space in the path. I reinstalled it at "C:\PowerShell" and now it builds ok. I still don't understand why it would build ok from the terminal though.