I guess the error comes from the login:docker. I’ve not seen it run via NPM before, but essentially this would be the same as a docker login <args> command.
I would imagine that you don’t have Docker installed in this container, nor a Docker daemon running; I think the setup_remote_docker command just contacts the Docker running in the host. You’re running stuff in the guest, so you don’t have anything to contact. However, Docker-in-Docker configurations do work - just install it first.
You can either install it using apt or apk (depending on the parent distro) or, if you don’t actually need Node and the pre-installed browsers, you can just switch to docker:17.05.0-ce-git (that’s the version I use, there’s probably something more recent).