I observed that the execution of a sample Node.js app in Eclipse (using the Nodeclipse plugin) results in the following error.
path.js:8
throw new TypeError('Path must be a string. Received ' +
^TypeError: Path must be a string. Received undefined
at assertPath (path.js:8:11)
at Object.posix.join (path.js:479:5)
at getPortsFile (/Users/Manglu/git/weather-company-data-demo/node_modules/ports/index.js:62:15)
at Object.<anonymous> (/Users/Manglu/git/weather-company-data-demo/node_modules/ports/index.js:13:29)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
Initially, I suspected if this was the result of a Node.js upgrade that I performed recently. However I narrowed it down to either Eclipse/Nodeclipse as the application runs without an issue when executed in a terminal session.
Checking the "pass all environment variables of Eclipse to launched Node.js app" in Eclipse preferences (for Nodeclipse) solves this issue.