Unable to build littlefs for nodemcu

I have the project configured for littlefs, and the library for littlefs is installed, but buildfs always generates SPIFFS.

[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
board_build.filesystem = littlefs
monitor_speed = 115200
lib_deps = 
me-no-dev/ESPAsyncTCP@^1.2.2
me-no-dev/ESP Async WebServer@^1.2.3
ayushsharma82/AsyncElegantOTA@^2.2.6
bblanchon/ArduinoJson@^6.18.5
arduino-libraries/Arduino_JSON@^0.1.0

    pio run --target buildfs -v -e nodemcuv2
Processing nodemcuv2 (platform: espressif8266; board: nodemcuv2; framework: arduino; monitor_speed: 115200; lib_deps: me-no-dev/ESPAsyncTCP@^1.2.2, me-no-dev/ESP Async WebServer@^1.2.3, ayushsharma82/AsyncElegantOTA@^2.2.6, bblanchon/ArduinoJson@^6.18.5, arduino-libraries/Arduino_JSON@^0.1.0; board_build.filesystem: littlefs; lib_extra_dirs: /Users/sjohnson/Documents/PlatformIO/Libraries)
------------------------------------------------------------------------------------------------------------------------------------
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html
PLATFORM: Espressif 8266 (2.3.3) > NodeMCU 1.0 (ESP-12E Module)
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 3.20603.200130 (2.6.3) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.20800.0 (2.8.0) 
 - tool-mkspiffs 1.200.0 (2.0) 
 - toolchain-xtensa 2.40802.200502 (4.8.2)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Platform incompatible library /Users/sjohnson/Documents/PlatformIO/Projects/icemelt-server2/.pio/libdeps/nodemcuv2/AsyncTCP
More details about "Library Compatibility Mode": https://docs.platformio.org/page/librarymanager/ldf.html#ldf-compat-mode
Found 47 compatible libraries
Scanning dependencies...
Warning: Ignored `AsyncTCP` dependency for `ESP Async WebServer` library
Warning! Circular dependencies detected between `/Users/sjohnson/Documents/PlatformIO/Projects/icemelt-server2/.pio/libdeps/nodemcuv2/ESP Async WebServer` and `/Users/sjohnson/Documents/PlatformIO/Projects/icemelt-server2/.pio/libdeps/nodemcuv2/AsyncElegantOTA`
Dependency Graph
|-- <ESPAsyncTCP> 1.2.2 (/Users/sjohnson/Documents/PlatformIO/Projects/icemelt-server2/.pio/libdeps/nodemcuv2/ESPAsyncTCP)
|   |-- <ESP8266WiFi> 1.0 (/Users/sjohnson/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi)
|-- <ESP Async WebServer> 1.2.3 (/Users/sjohnson/Documents/PlatformIO/Projects/icemelt-server2/.pio/libdeps/nodemcuv2/ESP Async WebServer)
|   |-- <ESPAsyncTCP> 1.2.2 (/Users/sjohnson/Documents/PlatformIO/Projects/icemelt-server2/.pio/libdeps/nodemcuv2/ESPAsyncTCP)
|   |   |-- <ESP8266WiFi> 1.0 (/Users/sjohnson/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi)
|   |-- <Hash> 1.0 (/Users/sjohnson/.platformio/packages/framework-arduinoespressif8266/libraries/Hash)
|   |-- <ESP8266WiFi> 1.0 (/Users/sjohnson/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi)
|   |-- <ArduinoJson> 6.18.5 (/Users/sjohnson/Documents/PlatformIO/Projects/icemelt-server2/.pio/libdeps/nodemcuv2/ArduinoJson)
|-- <AsyncElegantOTA> 2.2.6 (/Users/sjohnson/Documents/PlatformIO/Projects/icemelt-server2/.pio/libdeps/nodemcuv2/AsyncElegantOTA)
|   |-- <ESP8266WiFi> 1.0 (/Users/sjohnson/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi)
|   |-- <ESPAsyncTCP> 1.2.2 (/Users/sjohnson/Documents/PlatformIO/Projects/icemelt-server2/.pio/libdeps/nodemcuv2/ESPAsyncTCP)
|   |   |-- <ESP8266WiFi> 1.0 (/Users/sjohnson/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi)
|   |-- <ESP Async WebServer> 1.2.3 (/Users/sjohnson/Documents/PlatformIO/Projects/icemelt-server2/.pio/libdeps/nodemcuv2/ESP Async WebServer)
|   |   |-- <ESPAsyncTCP> 1.2.2 (/Users/sjohnson/Documents/PlatformIO/Projects/icemelt-server2/.pio/libdeps/nodemcuv2/ESPAsyncTCP)
|   |   |   |-- <ESP8266WiFi> 1.0 (/Users/sjohnson/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi)
|   |   |-- <Hash> 1.0 (/Users/sjohnson/.platformio/packages/framework-arduinoespressif8266/libraries/Hash)
|   |   |-- <ESP8266WiFi> 1.0 (/Users/sjohnson/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi)
|   |   |-- <ArduinoJson> 6.18.5 (/Users/sjohnson/Documents/PlatformIO/Projects/icemelt-server2/.pio/libdeps/nodemcuv2/ArduinoJson)
|-- <ArduinoJson> 6.18.5 (/Users/sjohnson/Documents/PlatformIO/Projects/icemelt-server2/.pio/libdeps/nodemcuv2/ArduinoJson)
|-- <Arduino_JSON> 0.1.0 (/Users/sjohnson/Documents/PlatformIO/Projects/icemelt-server2/.pio/libdeps/nodemcuv2/Arduino_JSON)
|-- <LittleFS(esp8266)> 0.1.0 (/Users/sjohnson/.platformio/packages/framework-arduinoespressif8266/libraries/LittleFS)
|-- <ESP8266WiFi> 1.0 (/Users/sjohnson/.platformio/packages/framework-arduinoespressif8266/libraries/ESP8266WiFi)
Building in release mode
"mkspiffs" -c data -p 256 -b 8192 -s 1024000 .pio/build/nodemcuv2/spiffs.bin
/favicon-144x144.png
/temp.csv
/favicon.ico
/index.html
/main.css
/edit.html
/manifest.json
/success.html
/temperatureGraph.js
=================================================== [SUCCESS] Took 0.54 seconds ===================================================

Also, I have to use the command line tool because there is no PLATFORM category under PROJECT TASKS, and thus no “Build Filesystem”.

I am running platformio with vscode on a macbook pro (M1).

I just checked my packages folder and tool-mklittlefs is missing. Is there a way for me to install it?

drwxr-xr-x  14 sjohnson  staff   448 Dec 21 20:12 .
drwxr-xr-x  10 sjohnson  staff   320 Dec 25 16:49 ..
drwx------  13 sjohnson  staff   416 Nov 20 15:01 contrib-piohome
drwx------  59 sjohnson  staff  1888 Nov  1  2020 contrib-pysite
drwx------  11 sjohnson  staff   352 Nov  1  2020 framework-arduino-avr
drwx------  17 sjohnson  staff   544 Feb 23  2020 framework-arduinoespressif8266
drwx------   5 sjohnson  staff   160 Dec 17 22:16 tool-esptool
drwx------  18 sjohnson  staff   576 Nov  1  2020 tool-esptoolpy
drwx------   5 sjohnson  staff   160 Dec 21 20:12 tool-mkspiffs
drwx------  13 sjohnson  staff   416 Dec 17 22:16 tool-scons
drwx------  12 sjohnson  staff   384 Nov  1  2020 tool-unity
drwx------  14 sjohnson  staff   448 Nov  1  2020 toolchain-atmelavr
drwx------  10 sjohnson  staff   320 Dec 17 22:16 toolchain-xtensa
drwx------  10 sjohnson  staff   320 Nov  1  2020 toolchain-xtensa@2.40802.191122

Ok, I think I have it fixed. I had to manually edit espressif8266/platform.json and change the optional flag:

"tool-mklittlefs": {
  "type": "uploader",
  "optional": false,
  "owner": "platformio",
  "version": "~1.203.0"
}

Yeah no way this can work. as seen in platform-espressif8266 release page, support for changing filesystems via board_build.filesystem was introduced in version 2.6.0 – you are running 2.3.3 where this did not exist.

You should open a CLI and execute pio platform update espressif8266 to udpate your platform and then verify that it’s now running the latest 3.2.0 version in the build output.

It seems that running:
platformio run --target uploadfs -e nodemcuv2
after the edit caused the tool to be installed.

Subsequent runs showed version 3.2.0. Not sure if the update happened automatically or if I must have run it in a different terminal window.

Anyway, all good now, and I noticed that now that the tool is installed, I do have PROJECT TASKS → PLATFORM → … menu options for building and uploading images.

Actually, I do remember running the update from the UI, not sure if it was before or after the edit to the JSON, although I think before because as soon as I edited the file, it started working.