I am hitting a weird problem. When in a snap I try to npm-install a package (in a directory under $SNAP_USER_DATA), I get the following error:
ERR! request to https://registry.npmjs.org/[PACKAGE-NAME-OMITTED] failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org
After some searching this error apparently is typically associated with DNS errors. So I ssh'd to the ctrlX CORE and run a ping command to the Google DNS, which succeeded:
$ ping 22.214.171.124 PING 126.96.36.199 (188.8.131.52) 56(84) bytes of data. 64 bytes from 184.108.40.206: icmp_seq=1 ttl=117 time=14.1 ms 64 bytes from 220.127.116.11: icmp_seq=2 ttl=117 time=16.9 ms [...]
However, when I pinged registry.npmjs.org, I got not responses.
$ ping registry.npmjs.org PING registry.npmjs.org (18.104.22.168) 56(84) bytes of data. ping: sendmsg: No buffer space available ping: sendmsg: No buffer space available [...]
I ran the same commands in a Debian VM in the same network, and both the pings to Google and the npm registry succeeded. Now, interestingly enough, the DNS part did work, i.e. the ctrlX CORE ping and the VM ping both resolved to the same IP, it is just that the ctrlX CORE ping to the npm registry did not return anyting. I was obviously also able to install the package without issues in the Debian VM.
Any thoughts/clues as to what may be wrong???
Solved! Go to Solution.
sorry for the late reply.
The operating system ctrlX CORE is based on is Ubuntu Core. Ubuntu Core is based on snaps and other package managers are not supported (like APT or npm).
If you want to use a npm-package inside of your snap, you have to bring it with your snap (parts) to the ctrlX CORE.