Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/35.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Eclipse中启动Node.js应用程序(使用NodeEclipse插件)会导致Path中出现字符串错误_Node.js_Eclipse_Nodeclipse - Fatal编程技术网

在Eclipse中启动Node.js应用程序(使用NodeEclipse插件)会导致Path中出现字符串错误

在Eclipse中启动Node.js应用程序(使用NodeEclipse插件)会导致Path中出现字符串错误,node.js,eclipse,nodeclipse,Node.js,Eclipse,Nodeclipse,我注意到在Eclipse中执行一个示例Node.js应用程序(使用NodeEclipse插件)会导致以下错误 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 getPo

我注意到在Eclipse中执行一个示例Node.js应用程序(使用NodeEclipse插件)会导致以下错误

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)
path.js:8
抛出新类型错误('路径必须是字符串。已接收'+
^TypeError:路径必须是字符串。未定义接收的路径
在assertPath(path.js:8:11)
在Object.posix.join(path.js:479:5)
在getPortsFile(/Users/Manglu/git/weather company data demo/node_modules/ports/index.js:62:15)
在对象上。(/Users/Manglu/git/weather company data demo/node_modules/ports/index.js:13:29)
在模块处编译(Module.js:409:26)
在Object.Module.\u extensions..js(Module.js:416:10)
在Module.load(Module.js:343:32)
在Function.Module.\u加载(Module.js:300:12)
at Module.require(Module.js:353:17)
根据需要(内部/module.js:12:17)
起初,我怀疑这是否是我最近执行的Node.js升级的结果。但是,我将其缩小为Eclipse/nodeEclipse,因为应用程序在终端会话中运行时没有问题。

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


最好知道默认情况下缺少了什么确切的环境变量。(请参阅NodeEclipse控制台)。在这里提出的问题对我来说是有效的,而手动设置
路径
变量却没有。引用@palverest,了解实际需要什么(显然,业务范围的环境变量除外)。