繁体   English   中英

在Eclipse中启动Node.js应用程序(使用Nodeclipse插件)导致Path必须是字符串错误

[英]Starting a Node.js app in Eclipse (using Nodeclipse plugin) results in Path must be a string error

我观察到在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,因为在终端会话中执行应用程序时,应用程序运行没有问题。

选中Eclipse首选项(用于Nodeclipse)中的“将Eclipse的所有环境变量传递给已启动的Node.js应用程序”解决了此问题。

Nodeclipse首选项

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM