Describe the problem
Arduino CLI 1.5.1 does not seem to discover libraries installed in the configured user libraries folder.
The library is correctly installed and detected by arduino-cli lib list, but during compilation the library resolver does not find it.
This behavior happens on both Windows and Ubuntu 24.04.
Environment
- OS: Ubuntu 24.04 (also reproduced on Windows)
- Arduino CLI version:
arduino-cli Version: 1.5.1
Commit: 01f3d4f2b
Date: 2026-06-05T10:22:17Z
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
Arduino CLI configuration
arduino-cli config dump:
board_manager:
additional_urls: []
directories:
data: /home/tiago/.arduino15
downloads: /home/tiago/.arduino15/staging
user: /home/tiago/Arduino
Installed libraries
arduino-cli lib list:
Name Installed Available Location Description
Servo 1.3.0 - user -
The library exists at:
/home/tiago/Arduino/libraries/Servo
with the expected structure:
Servo/
├── library.properties
└── src/
└── Servo.h
Sketch
MyFirstSketch.ino:
#include <Servo.h>
Servo myServo;
void setup() {
myServo.attach(9);
}
void loop() {
}
Compile command
or:
arduino-cli compile --fqbn arduino:avr:uno
Error output
Compilation fails with:
fatal error: Servo.h: No such file or directory
#include <Servo.h>
^~~~~~~~~
compilation terminated.
Verbose compilation shows:
ResolveLibrary(Servo.h)
-> candidates: []
No candidates are found for the library.
Additional information
The same issue was reproduced on Windows.
Workaround
Moving the library folder from the user library location:
~/Arduino/libraries/Servo
to the AVR platform libraries folder:
~/.arduino15/packages/arduino/hardware/avr/1.8.8/libraries
makes compilation succeed.
Command used:
cp -rv ~/Arduino/libraries/Servo \
~/.arduino15/packages/arduino/hardware/avr/1.8.8/libraries
After moving the library, arduino-cli compile finds Servo.h and the sketch builds successfully.
Expected behavior
Libraries installed with:
arduino-cli lib install Servo
should be automatically discovered from the configured user libraries directory:
directories:
user: /home/tiago/Arduino
without requiring the library to be copied into the platform-specific libraries folder.
Additional logs
arduino-cli compile -v output:
FQBN: arduino:avr:uno
Using board 'uno' from platform in folder: /home/tiago/.arduino15/packages/arduino/hardware/avr/1.8.8
Using core 'arduino' from platform in folder: /home/tiago/.arduino15/packages/arduino/hardware/avr/1.8.8
Detecting libraries used...
/home/tiago/.arduino15/packages/arduino/tools/avr-gcc/7.3.0-atmel3.6.1-arduino7/bin/avr-g++ -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10607 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I/home/tiago/.arduino15/packages/arduino/hardware/avr/1.8.8/cores/arduino -I/home/tiago/.arduino15/packages/arduino/hardware/avr/1.8.8/variants/standard /home/tiago/.cache/arduino/sketches/0B532B3C68DF5C9F947628F4FA330A9D/sketch/MyFirstSketch.ino.cpp.merged -o /dev/null -MMD -MF /home/tiago/.cache/arduino/sketches/0B532B3C68DF5C9F947628F4FA330A9D/sketch/MyFirstSketch.ino.cpp.merged.libsdetect.d
Alternatives for Servo.h: []
ResolveLibrary(Servo.h)
-> candidates: []
Used platform Version Path
arduino:avr 1.8.8 /home/tiago/.arduino15/packages/arduino/hardware/avr/1.8.8
Error during build: exit status 1
To reproduce
- Install Arduino CLI 1.5.1:
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sh
- Initialize Arduino CLI:
- Configure the Arduino user directory in
arduino-cli.yaml:
directories:
user: /home/$user/Arduino
- Install the Servo library:
arduino-cli lib install Servo
- Verify that the library is installed in the user libraries folder:
Expected output:
Name Installed Location
Servo 1.3.0 user
The library is located at:
/home/$user/Arduino/libraries/Servo
- Create a new Arduino sketch:
arduino-cli sketch new MyFirstSketch
cd MyFirstSketch
- Add the following code to
MyFirstSketch.ino:
#include <Servo.h>
Servo myServo;
void setup() {
myServo.attach(9);
}
void loop() {
}
- Install the Arduino AVR platform:
arduino-cli core install arduino:avr
- Compile the sketch:
arduino-cli compile --fqbn arduino:avr:uno
- Compilation fails with:
fatal error: Servo.h: No such file or directory
#include <Servo.h>
^~~~~~~~~
compilation terminated.
Verbose compilation output shows:
ResolveLibrary(Servo.h)
-> candidates: []
indicating that the library resolver does not find the installed user library.
Expected behavior
Libraries installed using:
arduino-cli lib install <library-name>
should be automatically discovered by Arduino CLI during compilation from the configured user libraries directory.
Given the following configuration:
directories:
user: /home/tiago/Arduino
and an installed library located at:
/home/tiago/Arduino/libraries/Servo
running:
arduino-cli compile --fqbn arduino:avr:uno
should resolve the dependency and compile the sketch successfully.
The verbose output should show the library being detected, for example:
Alternatives for Servo.h: [Servo@1.3.0]
ResolveLibrary(Servo.h)
-> Servo@1.3.0
The user should not need to manually copy libraries into platform-specific directories such as:
~/.arduino15/packages/arduino/hardware/avr/1.8.8/libraries
because libraries installed in the configured user library folder should be available to all compatible boards and platforms.
Arduino CLI version
arduino-cli Version: 1.5.1 Commit: 01f3d4f Date: 2026-06-05T10:22:17Z
Operating system
Linux
Operating system version
24.04
Additional context
No response
Issue checklist
Describe the problem
Arduino CLI 1.5.1 does not seem to discover libraries installed in the configured user libraries folder.
The library is correctly installed and detected by
arduino-cli lib list, but during compilation the library resolver does not find it.This behavior happens on both Windows and Ubuntu 24.04.
Environment
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | shArduino CLI configuration
arduino-cli config dump:Installed libraries
arduino-cli lib list:The library exists at:
with the expected structure:
Sketch
MyFirstSketch.ino:Compile command
or:
Error output
Compilation fails with:
Verbose compilation shows:
No candidates are found for the library.
Additional information
The same issue was reproduced on Windows.
Workaround
Moving the library folder from the user library location:
to the AVR platform libraries folder:
makes compilation succeed.
Command used:
After moving the library,
arduino-cli compilefindsServo.hand the sketch builds successfully.Expected behavior
Libraries installed with:
should be automatically discovered from the configured user libraries directory:
without requiring the library to be copied into the platform-specific
librariesfolder.Additional logs
arduino-cli compile -voutput:To reproduce
curl -fsSL https://raw.githubusercontent.com/arduino/arduino-cli/master/install.sh | sharduino-cli.yaml:Expected output:
The library is located at:
arduino-cli sketch new MyFirstSketch cd MyFirstSketchMyFirstSketch.ino:Verbose compilation output shows:
indicating that the library resolver does not find the installed user library.
Expected behavior
Libraries installed using:
should be automatically discovered by Arduino CLI during compilation from the configured user libraries directory.
Given the following configuration:
and an installed library located at:
running:
should resolve the dependency and compile the sketch successfully.
The verbose output should show the library being detected, for example:
The user should not need to manually copy libraries into platform-specific directories such as:
because libraries installed in the configured user library folder should be available to all compatible boards and platforms.
Arduino CLI version
arduino-cli Version: 1.5.1 Commit: 01f3d4f Date: 2026-06-05T10:22:17Z
Operating system
Linux
Operating system version
24.04
Additional context
No response
Issue checklist