求助mac安装karma时,贴代码如下,后面还有希望这些代码能说明问题,


oukokudongdeMBP:~ wangguodong$ sudo npm install -g karma
Password:
npm WARN engine [email protected] : wanted: {"node":"~0.8 || ~0.10"} (current: {"node":"0.12.2","npm":"2.7.4"})

[email protected] 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 [email protected]

npm node-gyp karma node.js

某市的小疯子 10 years, 1 month ago

这句话的意思是你的node版本与karma不匹配。

karma希望你的配置是: wanted: {"node":"~0.8 || ~0.10"}

而你当前的是:(current: {"node":"0.12.2","npm":"2.7.4"})

解决办法:装个切换node版本的模块,比如 n

小枫Maple answered 10 years, 1 month ago

Your Answer