在我的Phonegap项目中,浏览器控制台中显示以下错误:
GET http://192.168.137.1:3000/cordova_plugins.js 500 (Internal Server Error)
exports.injectScript @ cordova.js:1528
injectIfNecessary @ cordova.js:1536
exports.load @ cordova.js:1616
(anonymous) @ cordova.js:1129
当我转到http://192.168.137.1:3000/cordova_plugins.js
时,会显示:
TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.join (path.js:466:7)
at Object.handle (C:\Program Files (x86)\Adobe\PhoneGap\PhoneGap Desktop\resources\app.asar.unpacked\node_modules\connect-phonegap\lib\middleware\cordova\cordova_plugins.js:18:33)
at next (C:\Program Files (x86)\Adobe\PhoneGap\PhoneGap Desktop\resources\app.asar.unpacked\node_modules\connect\lib\proto.js:174:15)
at Object.handle (C:\Program Files (x86)\Adobe\PhoneGap\PhoneGap Desktop\resources\app.asar.unpacked\node_modules\connect-phonegap\lib\middleware\cordova\cordova.js:33:13)
at next (C:\Program Files (x86)\Adobe\PhoneGap\PhoneGap Desktop\resources\app.asar.unpacked\node_modules\connect\lib\proto.js:174:15)
at SendStream.error (C:\Program Files (x86)\Adobe\PhoneGap\PhoneGap Desktop\resources\app.asar.unpacked\node_modules\serve-static\index.js:120:7)
at emitOne (events.js:96:13)
at SendStream.emit (events.js:188:7)
at SendStream.error (C:\Program Files (x86)\Adobe\PhoneGap\PhoneGap Desktop\resources\app.asar.unpacked\node_modules\send\index.js:245:17)
cordova_plugins.js
错误的一般原因似乎是将其包含在应用程序的html中,但我不是这样做的;我所包含的唯一的cordova脚本是<script type="text/javascript" src="cordova.js"></script>
。
有谁知道发生了什么以及如何解决错误?