2016-02-28 36 views
0

我得到一个错误,当我在凌凌主编包安装错误

npm ERR! Windows_NT 6.2.9200 
npm ERR! argv "C:\\Users\\Jarvis\\AppData\\Local\\atom\\app-1.5.3\\resources\\app\\apm\\bin\\node.exe" "C:\\Users\\Jarvis\\AppData\\Local\\atom\\app-1.5.3\\resources\\app\\apm\\node_modules\\npm\\bin\\npm-cli.js" "--globalconfig" "C:\\Users\\Jarvis\\.atom\\.apm\\.apmrc" "--userconfig" "C:\\Users\\Jarvis\\.atom\\.apmrc" "install" "C:\\Users\\Jarvis\\AppData\\Local\\Temp\\d-116128-3752-1lwywgv\\package.tgz" "--target=0.34.5" "--arch=ia32" 
npm ERR! node v0.10.40 
npm ERR! npm v2.13.3 
npm ERR! file C:\Users\Jarvis\.atom\.apm\nopt\3.0.6\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\Jarvis\.atom\.apm\nopt\3.0.6\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 

安装软件包我试图安装大量的包在原子编辑器,但我得到上述错误。

回答

0

如果您使用Notpad ++(或您选择的任何其他编辑器打开C:\Users\Jarvis\.atom\.apm\nopt\3.0.6\package\package.json - 只是不要在atom中执行,它会崩溃,至少在版本1.6.2中它会为我执行)并查找不可打印字符。你会看到该文件包含很多NUL。有一天,我尝试安装我的软件包更新时突然出现了相同的错误。

这是我做了什么来解决这个错误。不过要注意的是,你必须重新安装所有的软件包。我个人使用同步设置(备份我的软件包等),所以对我来说没什么大不了的。

  • 删除整个C:\用户\ Jarvis.atom \ Packages文件夹
  • 删除entier C:\用户\ Jarvis.atom.apm文件夹
  • 重新安装所有的软件包(.apm文件夹,然后将装自动)

由于路径太长限制,可能很难删除这些文件夹。在这种情况下,这有助于Stackexchange答案:How to delete a file in Windows with a too long filename?