yoursunny / NDNts

NDN libraries for the Modern Web
https://ndnts-docs.ndn.today
ISC License
31 stars 9 forks source link

"Error: connect ENOENT /run/nfd.sock" on macOS #3

Closed tanim-ics closed 3 years ago

tanim-ics commented 3 years ago

I have installed NDNts, Node.js v14.17.4, and npm v6.14.4. I have installed nightly builds. I created a producer and trying to run it. NFD is also running. But it is throwing the following error:


NDNts % NDNTS_NFDREG=1 node ./producer.mjs
(node:46681) UnhandledPromiseRejectionWarning: Error: connect ENOENT /run/nfd.sock
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1148:16)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:46681) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:46681) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
yoursunny commented 3 years ago

From the error message, it's probably a path mismatch. Default Unix socket path in NDNts is /run/nfd.sock but NFD on macOS listens on /var/run/nfd.sock. You can try setting this environment variable: NDNTS_UPLINK=unix:///var/run/nfd.sock

Note that NDNts does not officially support Node.js on macOS. You can run Debian or Ubuntu in Parallels Desktop, and then run NDNts inside.

tanim-ics commented 3 years ago

Thank you. Both the Producer and the consumer worked after adding the environment variable.