2015-06-22 103 views
0

我的电脑崩溃了,现在没有安装包可以使用。为什么我不能用npm安装任何gulp依赖项?

这就是在命令行所示:

npm install --save-dev gulp-autoprefixer 
npm ERR! Windows_NT 6.3.9600 
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-c 
li.js" "install" "--save-dev" "gulp-autoprefixer" 
npm ERR! node v0.12.0 
npm ERR! npm v2.10.1 
npm ERR! file C:\Users\buddy\AppData\Roaming\npm-cache\readable-stream\1.0.33\package\package.json 
npm ERR! code EJSONPARSE 

npm ERR! Failed to parse json 
npm ERR! Unexpected token 
npm ERR! File: C:\Users\buddy\AppData\Roaming\npm-cache\readable-stream\1.0.33\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\buddy\Desktop\BuildTest\npm-debug.log 
+0

我看到一些令人不安的'npm-debug.log'。请[编辑]添加。 –

+0

npm-debug.log非常长,这就是为什么我没有发布它。这里是否有字符限制? – 91eahz

+0

为了将来的参考,有但是30k个字符通常就足够了。这个技巧是在最近发生错误之前将日志修剪到重要部分。 –

回答

2

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.

,告诉你,你需要知道的一切。您需要确保您的package.json是有效的JSON。

我会建议linting它,也许通过http://jsonlint.com/

+0

我做了它没有问题。虽然我通过删除我的npm-cache文件夹解决了这个问题,但现在一切似乎都奏效@Nathan – 91eahz