When seeking help from mac to install karma, the following code was posted. I hope these codes can explain the problem.

  node.js, question

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

This sentence means that your version of node does not match karma.

Karma wants your configuration to be: wanted: {“node”:”~0.8 || ~0.10″}

And your current is: (current: {“node”: “0.12.2”, “NPM”: “2.7.4”})

Solution: install a module to switch node versions, such asn