今天在npm install的时候出现了如下错误:
npm ERR! install Couldn't read dependencies
npm ERR! Failed to parse json
npm ERR! Unexpected token /
npm ERR! File: /Users/mac/project/test/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! System Darwin 11.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /Users/mac/project/test
npm ERR! node -v v0.8.9
npm ERR! npm -v 1.1.61
npm ERR! file /Users/mac/project/test/package.json
npm ERR! code EJSONPARSE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/mac/project/test/npm-debug.log
npm ERR! not ok code 0
在网上查了一下,发现是因为package.json这个文件里面有注释,只要把这些注释删掉就ok了