Relevant lines from 'strace' output:
[pid 678] 18:17:52 socket(AF_INET, SOCK_STREAM|SOCK_CLOEXEC|SOCK_NONBLOCK, IPPROTO_IP) = 18
[pid 678] 18:17:52 setsockopt(18, SOL_TCP, TCP_NODELAY, [1], 4) = 0
[pid 678] 18:17:52 connect(18, {sa_family=AF_INET, sin_port=htons(443), sin_addr=inet_addr("104.16.22.35")}, 16) = -1 EINPROGRESS (Operation now in progress)
[pid 678] 18:17:52 epoll_ctl(13, EPOLL_CTL_ADD, 18, {EPOLLOUT, {u32=18, u64=18}}) = 0
[pid 678] 18:17:52 epoll_wait(13, [{EPOLLOUT|EPOLLERR|EPOLLHUP, {u32=18, u64=18}}], 1024, 7523) = 1
[pid 678] 18:17:52 getsockopt(18, SOL_SOCKET, SO_ERROR, [101], [4]) = 0
[pid 678] 18:17:52 epoll_ctl(13, EPOLL_CTL_DEL, 18, 0x7ffcc1878020) = 0
[pid 678] 18:17:52 close(18) = 0
...
[pid 678] 18:17:52 write(2, "npm", 3npm) = 3
[pid 678] 18:17:52 write(2, " ", 1 ) = 1
[pid 678] 18:17:52 write(2, "ERR!", 4ERR!) = 4
[pid 678] 18:17:52 write(2, " ", 1 ) = 1
[pid 678] 18:17:52 write(2, "code", 4code) = 4
[pid 678] 18:17:52 write(2, " ENETUNREACH\n", 13 ENETUNREACH
) = 13
The failing call is the 'connect()'. It's asynchronous -- the following calls collect its failure status of ENETUNREACH.