在Eclipse中启动Node.js应用程序(使用Nodeclipse插件)结果Path中必须是string错误

我观察到,在Eclipse中使用Nodeclipse插件执行示例Node.js应用程序会导致以下错误。

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) 

最初,我怀疑这是否是最近我执行的Node.js升级的结果。 但是,我将其缩小到Eclipse / Nodeclipse,因为应用程序在terminal会话中执行时没有问题。

在Eclipse首选项(适用于Nodeclipse)中检查“将Eclipse的所有环境variables传递给启动的Node.js应用程序”解决了这个问题。

Nodeclipse首选项