I might have an answer:
I ran into the same (or very, very similar) problem, on Mac OS X Mojave.
In the end, I reverted to completely uninstalling Node.js (this experience does not help convincing me of Node.js but that is another story) and start from scratch.
Even that did not help because I ran into trouble installing nodemcu-tool ...
Previously I installed it as a global package, and that somehow worked, but it caused me to always sudo my nodemcu-tool invocations - not a good thing!
In any case, sudo-ing plus the commandline parameter "--connection_delay" (or as a project setting, "connectionDelay") helped getting me going.
Until I messed up, and reinstalled everything from scratch. However, the key difference to the instructions for installing nodemcu-tool was adding the '--unsafe-perm' parameter to it, like so:
sudo npm install --unsafe-perm nodemcu-tool -g
That was to be able to get past the repeated installation errors for the serialport package...
IMO, relying on unsafe permissions (for what exactly, anyway!?) is, well, UNSAFE! GRRRRR
To the OP, make sure that:
- you have installed Node.js and nodemcu-tool properly (download stable installer etc), and
- that you use the --connection_delay parameter in each and every nodemcu-tool invocation!
nodemcu-tool mkfs --connection-delay 1000
(it uses the project settings file.nodemcutool
). – MDrNodeMCU custom build by frightanic.com branch: master commit: 11592951b90707cdcb6d751876170bf4da82850d SSL: true modules: cron,file,gpio,http,i2c,mdns,mqtt,net,node,ow,pwm,sntp,tmr,uart,wifi,wifi_monitor,tls build created on 2019-01-06 12:35 powered by Lua 5.1.4 on SDK 2.2.1(6ab97e9) lua: cannot open init.lua > Heap size:40816.
– MDrdev
branch, nodemcu-tool 3.0.2, WeMos D1 mini Pro on macOS. – Marcel Stör