Alexander Komarov let me try to reproduce your setup, without docker (master linux -> slave linux) and your job/global tool configuration.
Just to clarify if you do not have jenkins.plugins.nodejs.tools.NodeJSInstallation.xml file in the home of master jenkins near the others persistence file:
- disk-usage -> hudson.plugins.disk_usage.DiskUsageProperty.xml
- Maven -> hudson.tasks.Maven.xml
- Ant -> hudson.tasks.Ant.xml
If you reboot Jenkins instance NodeJS global tool configuration will be lost (you have to redefine them). Your it's a very unreproducible strange case.
Anyway the case of npm install -g with empty list of packages was fixed in master.