想把 win 上的 hexo 换到 mac 里 却报错了

2015-02-04 15:25:27 +08:00
 Eymard

一直用的是win上的hexo,从来没发生过问题,结果今天配置mac上的环境怎么弄也弄不好,不太会用终端 = =
sudo npm install -g hexo
Password:

fsevents@0.2.0 install /usr/local/lib/node_modules/hexo/node_modules/chokidar/node_modules/fsevents
node-gyp rebuild

gyp ERR! UNCAUGHT EXCEPTION
gyp ERR! stack Error: EPERM, utime '/Users/zhanghaoyu/.node-gyp/0.10.36'
gyp ERR! System Darwin 13.4.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/hexo/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v0.10.36
gyp ERR! node-gyp -v v1.0.1
gyp ERR! This is a bug in node-gyp.
gyp ERR! Try to update node-gyp and file an Issue if it does not help:
gyp ERR! https://github.com/TooTallNate/node-gyp/issues
npm WARN optional dep failed, continuing fsevents@0.2.0
/usr/local/bin/hexo -> /usr/local/lib/node_modules/hexo/bin/hexo
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/npm-package-arg requires semver@'4' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/semver,
npm WARN unmet dependency which is version 2.3.0
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/read-installed/node_modules/readdir-scoped-modules requires graceful-fs@'^3.0.4' but will load
npm WARN unmet dependency /usr/local/lib/node_modules/npm/node_modules/graceful-fs,
npm WARN unmet dependency which is version 3.0.2
hexo@2.8.3 /usr/local/lib/node_modules/hexo
├── strip-indent@0.1.3
├── hexo-front-matter@0.0.4
├── sprintf-js@0.0.7
├── graceful-fs@3.0.5
├── colors@0.6.2
├── mime@1.2.11
├── minimist@0.2.0
├── async@0.9.0
├── warehouse@0.2.2 (async@0.7.0)
├── highlight.js@8.1.0
├── lodash@2.4.1
├── moment@2.9.0
├── js-yaml@3.2.5 (esprima@1.0.4, argparse@0.1.16)
├── morgan@1.5.1 (depd@1.0.0, basic-auth@1.0.0, debug@2.1.1, on-finished@2.2.0)
├── connect@3.3.4 (utils-merge@1.0.0, parseurl@1.3.0, debug@2.1.1, finalhandler@0.3.3)
├── compression@1.4.0 (on-headers@1.0.0, vary@1.0.0, bytes@1.0.0, compressible@2.0.2, accepts@1.2.3, debug@2.1.1)
├── cheerio@0.17.0 (entities@1.1.1, dom-serializer@0.0.1, CSSselect@0.4.1, htmlparser2@3.7.3)
├── chokidar@0.8.2 (recursive-readdir@0.0.2)
├── serve-static@1.8.1 (escape-html@1.0.1, utils-merge@1.0.0, parseurl@1.3.0, send@0.11.1)
└── swig@1.4.1 (optimist@0.6.1, uglify-js@2.4.16)
求大牛指点迷津 T T

6189 次点击
所在节点    问与答
6 条回复
Eymard
2015-02-04 15:52:13 +08:00
求帮助 T T
mcfog
2015-02-04 16:36:42 +08:00
试试看
```
sudo npm up npm -g
```
升级一下npm试试看
Eymard
2015-02-04 22:03:41 +08:00
@mcfog 还是报错..
npm ERR! System Darwin 13.4.0
npm ERR! command "node" "/usr/local/bin/npm" "up" "npm" "-g"
npm ERR! cwd /Users/
npm ERR! node -v v0.10.36
npm ERR! npm -v 1.4.28
npm ERR! path /usr/local/share/man/man1/npm-adduser.1
npm ERR! code EEXIST
npm ERR! error rolling back Error: Refusing to delete: /usr/local/share/man/man1/npm-README.1 not in /usr/local/lib/node_modules/npm
npm ERR! error rolling back at clobberFail (/usr/local/lib/node_modules/npm/lib/utils/gently-rm.js:57:12)
npm ERR! error rolling back at next (/usr/local/lib/node_modules/npm/lib/utils/gently-rm.js:43:14)
npm ERR! error rolling back at /usr/local/lib/node_modules/npm/lib/utils/gently-rm.js:52:12
npm ERR! error rolling back at Object.oncomplete (evalmachine.<anonymous>:108:15)
npm ERR! error rolling back { [Error: Refusing to delete: /usr/local/share/man/man1/npm-README.1 not in /usr/local/lib/node_modules/npm]
npm ERR! error rolling back code: 'EEXIST',
npm ERR! error rolling back path: '/usr/local/share/man/man1/npm-README.1' }
npm ERR! not ok code 0
Eymard
2015-02-05 16:25:57 +08:00
弄了一天还是不行,究竟是什么问题....
sky200277
2015-02-17 10:31:23 +08:00
一样遇到这个问题,现在已解决。说一下解决方案:
sudo npm install -g hexo --registry=https://registry.npm.taobao.org
这样做后虽然仍然会有warn错误,但是等一下就好了。
waylife
2015-09-03 23:01:46 +08:00
@mcfog 有用, thx 。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/168208

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX