oukokudongdeMBP:~ wangguodong$ sudo npm install -g karma
Password:
npm WARN engine karma@0.12.31: wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"0.12.2","npm":"2.7.4"})
fsevents@0.3.6 install /usr/local/lib/node_modules/karma/node_modules/chokidar/node_modules/fsevents
node-gyp rebuild
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EPERM, utime '/Users/wangguodong/.node-gyp/0.12.2'
gyp ERR! stack at Error (native)
gyp ERR! System Darwin 14.1.0
gyp ERR! command "node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/karma/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v0.12.2
gyp ERR! node-gyp -v v1.0.3
gyp ERR! not ok
npm WARN optional dep failed, continuing fsevents@0.3.6
这句话的意思是你的node版本与karma不匹配。
karma希望你的配置是: wanted: {"node":"~0.8 || ~0.10"}
而你当前的是:(current: {"node":"0.12.2","npm":"2.7.4"})
解决办法:装个切换node版本的模块,比如 n