2016-11-16 243 views
0

我尝试在我的系统上安装Cordova,但遇到这些错误:npm install中的ERR -g 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> 

从未有过这样的问题。

+0

”告诉软件包作者修复他们的package.json文件。JSON.parse“ – OrangeDog

回答

0

npm有一个你已经安装的模块的本地缓存,所以可能有东西卡在模块中。请尝试:

npm cache clean 

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

+0

Tkanks很多!这有帮助! –

相关问题