cordova_plugins.js中的TypeError

时间:2016-07-30 17:08:05

标签: javascript cordova phonegap-plugins cordova-plugins phonegap-desktop-app

每当我使用PhoneGap桌面应用程序创建项目时,我都会在index.html文件的控制台中为cordova_plugins.js收到此错误:

**Failed to load resource: the server responded with a status of 500 (Internal Server Error)**

当我在浏览器中打开cordova_plugins.js文件时,它显示了这个 -

****TypeError: Path must be a string. Received undefined at assertPath (path.js:7:11) at Object.join (path.js:506:7) at Object.handle (D:\PhoneGap Desktop\resources\app.asar\node_modules\connect-phonegap\lib\middleware\cordova\cordova_plugins.js:18:33) at next (D:\PhoneGap Desktop\resources\app.asar\node_modules\connect\lib\proto.js:193:15) at Object.handle (D:\PhoneGap Desktop\resources\app.asar\node_modules\connect-phonegap\lib\middleware\cordova\cordova.js:33:13) at next (D:\PhoneGap Desktop\resources\app.asar\node_modules\connect\lib\proto.js:193:15) at resume (D:\PhoneGap Desktop\resources\app.asar\node_modules\connect\lib\middleware\static.js:65:7) at SendStream.error (D:\PhoneGap Desktop\resources\app.asar\node_modules\connect\lib\middleware\static.js:80:37) at emitOne (events.js:90:13) at SendStream.emit (events.js:182:7)****

该项目位于D:\Applications\samplApp. PhoneGap桌面安装在D:\PhoneGap Desktop

请帮我解决这个问题。也许正因为如此,我尝试在js中加载window.plugins.plugin_name的每个外部插件都会导致window.plugins未定义的错误。如果您需要任何其他信息,请询问。

1 个答案:

答案 0 :(得分:0)

您需要将插件安装到应用程序的文件夹中。

cordova plugins add plugin_name