npm install -g cordova 中的错误

ERR in npm install -g cordova

我尝试在我的系统上安装 Cordova,但遇到了这些错误:

我该怎么做才能解决这个问题?

C:\Users\madt>npm install -g cordova
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Users\madt\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js" "install" "-g" "cordova"
npm ERR! node v7.1.0
npm ERR! npm  v3.10.9
npm ERR! file C:\Users\madt\AppData\Roaming\npm-cache\isarray.0.0\package\package.json
npm ERR! code EJSONPARSE

npm ERR! Failed to parse json
npm ERR! Unexpected token '\u0000' at 1:1
npm ERR!
npm ERR! ^
npm ERR! File: C:\Users\madt\AppData\Roaming\npm-cache\isarray.0.0\package\package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! This is not a bug in npm.
npm ERR! Tell the package author to fix their package.json file. JSON.parse

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Users\madt\npm-debug.log

C:\Users\madt>

以前从来没有遇到过这样的问题。

npm 对您安装的模块有一个本地缓存,所以可能有些东西卡在了模块中。尝试:

npm cache clean 

它将删除缓存文件夹中的数据。