简体   繁体   English

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

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

I observed that the execution of a sample Node.js app in Eclipse (using the Nodeclipse plugin) results in the following 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)

Initially, I suspected if this was the result of a Node.js upgrade that I performed recently. 最初,我怀疑这是否是我最近执行的Node.js升级的结果。 However I narrowed it down to either Eclipse/Nodeclipse as the application runs without an issue when executed in a terminal session. 但是我将其范围缩小到Eclipse / Nodeclipse,因为在终端会话中执行应用程序时,应用程序运行没有问题。

Checking the "pass all environment variables of Eclipse to launched Node.js app" in Eclipse preferences (for Nodeclipse) solves this issue. 选中Eclipse首选项(用于Nodeclipse)中的“将Eclipse的所有环境变量传递给已启动的Node.js应用程序”解决了此问题。

Nodeclipse首选项

暂无
暂无

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

相关问题 node.js express应用程序将无法在Eclipse(Nodeclipse)中启动(或调试) - node.js express app won't start (or debug) in Eclipse (Nodeclipse) 在Ubuntu 12.04上设置node.js(使用eclipse / nodeclipse / enide) - Setting up node.js on Ubuntu 12.04 (with eclipse/nodeclipse/enide) 用于nodeclipse的eclipse中的节点监视路径 - Node Monitor Path in eclipse for nodeclipse 使用node.js应用启动Docker容器会产生错误; 抱怨PATH - Starting a docker container with a node.js app produces error; complains about PATH “路径”参数必须是字符串类型。 收到 TypeError 的实例。 使用 mongoose 在 Node.js 中出现此错误 - The "path" argument must be of type string. Received an instance of TypeError. Getting this error in Node.js with mongoose node.js TypeError:路径必须是字符串。 收到空值 - node.js TypeError: Path must be a string. Received null Node.js TypeError:path必须是字符串或Buffer - Node.js TypeError: path must be a string or Buffer 路径必须是字符串(需要 url 与 node.js http 模块) - Path must be a string (require url with node.js http module) Node.js 应用程序错误:MongooseError:`openUri()` 的 `uri` 参数必须是字符串,得到“未定义” - Node.js App Error: MongooseError: The `uri` parameter to `openUri()` must be a string, got "undefined" Eclipse 中的 node.js - 大多数人使用哪些插件? - node.js in Eclipse - which plugin(s) are most people using?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM