【发布时间】:2013-10-03 02:41:24
【问题描述】:
我在这里疯了。我正在使用 PhoneGap 3.0,并创建了一个带有一些插件的应用程序。我意识到我第一次安装的那些插件还不够,所以我尝试安装另一个。有问题的是捕获插件和文件传输插件。当我尝试在终端中添加插件时,出现此错误:
path.js:360
throw new TypeError('Arguments to path.join must be strings');
^
TypeError: Arguments to path.join must be strings
at path.js:360:15
at Array.filter (native)
at Object.exports.join (path.js:358:36)
at possiblyFetch (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/install.js:49:27)
at /usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/install.js:298:17
at Array.forEach (native)
at runInstall (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/install.js:229:22)
at possiblyFetch (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/install.js:64:9)
at Object.installPlugin [as install] (/usr/local/lib/node_modules/phonegap/node_modules/cordova/node_modules/plugman/src/install.js:44:5)
at doInstall (/usr/local/lib/node_modules/phonegap/node_modules/cordova/src/plugin.js:153:45)
我已经尝试了所有方法,包括创建一个全新的应用程序。但没有运气。
这是我需要做的一个对时间非常敏感的应用程序,因此非常感谢任何帮助。
谢谢!
【问题讨论】:
-
我刚刚尝试通过
cordova plugin add org.apache.cordova.file-transfer和cordova plugin add org.apache.cordova.media-capture添加这些插件,没有任何问题。这是 Cordova 3.0.10。你能在空项目上再试一次吗?另外,你在 Windows 上吗?在处理包含奇怪字符(如空格、连字符等)的文件名时,我之前在 Windows 上看到过类似的错误......您的项目是否在名称中使用了这些字符中的任何一个? -
我遇到了同样的问题。我在 mac 上,我的文件/文件夹名称只有标准字母字符。
-
@AlexBet 你解决了这个错误。我也面临同样的错误,但无法解决。请告诉我
-
@Immi 我确实想通了。加载插件的顺序似乎很重要。我想这是因为他们与其他插件的依赖关系。因此,如果您收到此错误,请查看插件的依赖项是什么,并在您需要的插件之前加载这些插件。