我在phonegap中安装了plugman但稍后在安装插件时它显示以下错误:
C:\Program Files\nodejs>plugman install --platform android --project c:\testApp
--plugin org.apache.cordova.camera
Installing "org.apache.cordova.camera" for android
Failed to install 'org.apache.cordova.camera':TypeError: Cannot read property 't
rim' of null
at new SemVer (C:\Users\INTEL\AppData\Roaming\npm\node_modules\plugman\node_
modules\cordova-lib\node_modules\semver\semver.js:253:18)
at compare (C:\Users\INTEL\AppData\Roaming\npm\node_modules\plugman\node_mod
ules\cordova-lib\node_modules\semver\semver.js:409:10)
at Function.gte (C:\Users\INTEL\AppData\Roaming\npm\node_modules\plugman\nod
e_modules\cordova-lib\node_modules\semver\semver.js:458:10)
at C:\Users\INTEL\AppData\Roaming\npm\node_modules\plugman\node_modules\cord
ova-lib\src\plugman\install.js:590:45
at _fulfilled (C:\Users\INTEL\AppData\Roaming\npm\node_modules\plugman\node_
modules\q\q.js:787:54)
at self.promiseDispatch.done (C:\Users\INTEL\AppData\Roaming\npm\node_module
s\plugman\node_modules\q\q.js:816:30)
at Promise.promise.promiseDispatch (C:\Users\INTEL\AppData\Roaming\npm\node_
modules\plugman\node_modules\q\q.js:749:13)
at C:\Users\INTEL\AppData\Roaming\npm\node_modules\plugman\node_modules\q\q.
js:509:49
at flush (C:\Users\INTEL\AppData\Roaming\npm\node_modules\plugman\node_modul
es\q\q.js:108:17)
at process._tickCallback (node.js:355:11)
Cannot read property 'trim' of null
C:\Program Files\nodejs>
无法读取NULL的属性'trim'。这是什么意思?
答案 0 :(得分:1)
我使用cordova cli时遇到了同样的问题。
我发现的是android平台有一组不同的插件然后cordova插件列表显示。为了解决这个问题,我刚刚删除了android平台,然后将其添加回来。之后,一切都得到了解决。
我希望这有助于任何有类似问题的人