npm中的错误安装-g cordova

时间:2016-11-16 13:45:11

标签: node.js cordova npm npm-install

我尝试在我的系统上安装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\1.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\1.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>

之前从未遇到过这样的问题。

1 个答案:

答案 0 :(得分:0)

npm为您安​​装的模块提供了本地缓存,因此可能会遇到模块问题。试试:

npm cache clean 

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