系统版本:osx 10.10
已经安装了Xcode,Xcode命令行工具
sudo npm install -g hexo
在命令行中抛如下警告信息:
[email protected] install /usr/local/lib/node_modules/hexo/node_modules/chokidar/node_modules/fsevents
node-gyp rebuildgyp WARN EACCES user "root" does not have permission to access the dev dir >"/Users/xiangwenwen/.node-gyp/0.10.33"
gyp WARN EACCES attempting to reinstall using temporary dev dir >"/usr/local/lib/node_modules/hexo/node_modules/chokidar/node_modules/fsevents/.node-gyp"
网上找了下资料,说是没有g++,我能确定自己安装了。
去掉 sudo 試試看
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "hexo"
npm ERR! node v0.10.33
npm ERR! npm v2.1.7
npm ERR! path /usr/local/lib/node_modules/hexo/.gitmodules
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/hexo/.gitmodules'
npm ERR! { [Error: EACCES, unlink '/usr/local/lib/node_modules/hexo/.gitmodules']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/hexo/.gitmodules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/hexo/.gitmodules'
npm ERR! error rolling back { [Error: EACCES, unlink '/usr/local/lib/node_modules/hexo/.gitmodules']
npm ERR! error rolling back errno: 3,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/hexo/.gitmodules' }
npm ERR! Please include the following file with any support request:
npm ERR! /Users/xiangwenwen/npm-debug.log
去掉sudo,是这样的。
你是依照 文件 中的方式安裝 Node.js 的嗎?如果不是的話試著依照文件重新安裝一遍試試看
我是用brew安装的nodejs
问题还是没有解决,想不明白来.....
又重新安装了一遍node
@tommy351 花了三个小时,最后一尝试,按照官网上的方式安装node,最后问题同上。把这个删了之后,用nvm安装node,再继续,问题依旧,同上。
gyp WARN EACCES user "root" does not have permission to access the dev dir "/Users/xiangwenwen/.node-gyp/0.10.33"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/Users/xiangwenwen/.nvm/v0.10.33/lib/node_modules/hexo/node_modules/chokidar/node_modules/fsevents/.node-gyp"
我尝试了很多种方式,都没办法解决这个问题,目前不清楚其他朋友,有没有遇到这种折磨诡异的事情。
最后一种尝试,sudo chmod 777 /var/root 归于权限问题?不报错,安装成功。
Please close this issue
今天在新 Mac 上安装遇到了同样的问题,Yosemite,用 Installer 安装的 node.js。去年在工作的 iMac 上安装时一切正常。不知为何。
----------更新-------------
权限问题
已自行解决
使用
sudo npm install -g -unsafe-perm hexo
遇到相同的问题
[email protected] install /usr/local/lib/node_modules/hexo/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: Connection closed while downloading tarball file
gyp ERR! stack at Request.
gyp ERR! stack at Request.emit (events.js:117:20)
gyp ERR! stack at IncomingMessage.
gyp ERR! stack at IncomingMessage.emit (events.js:117:20)
gyp ERR! stack at IncomingMessage.
gyp ERR! stack at IncomingMessage.emit (events.js:117:20)
gyp ERR! stack at _stream_readable.js:943:16
gyp ERR! stack at process._tickCallback (node.js:419:13)
gyp ERR! System Darwin 14.0.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.33
gyp ERR! node-gyp -v v1.0.1
gyp ERR! not ok
npm WARN optional dep failed, continuing [email protected]
我也遇到这个问题啦~~ 可是我使用chmod 777 /var/root 这个命令还是没有作用? 请问该怎么做啊
Mac上面不能使用nvm?
已经弄好了~~ 谢谢哈
在 2015年2月10日,20:29,漩涡 [email protected] 写道:
Mac上面不能使用nvm?
—
Reply to this email directly or view it on GitHub https://github.com/hexojs/hexo/issues/913#issuecomment-73691606.
提供一下如何解决的,方便后来人
sudo npm install -g -unsafe-perm hexo 虽然有报错,但是貌似不影响正常使用QAQ
-unsafe-perm 这个是什么选项?
嗯嗯 因为我找了一天多,都没有找到其他解决办法 有可能是yosemite10.10系统的问题
因为fsevent依赖的问题,出现warning是正常的,这个不算报错
这样啊~ 谢谢啦
一样遇到这个问题,现在已解决。说一下解决方案:
sudo npm install -g hexo --registry=https://registry.npm.taobao.org
这样做后虽然仍然会有warn错误,但是等一下就好了。
我也遇到了这样的问题,后面解决了,主要原因是没有装Xcode
可以跟着hexo官网那个setup一步一步进行配置
Best Regards,
Frank Bian
On May 29, 2015, at 1:36 PM, dupengtao [email protected] wrote:
我也遇到了这样的问题,后面解决了,主要原因是没有装Xcode
—
Reply to this email directly or view it on GitHub https://github.com/hexojs/hexo/issues/913#issuecomment-106695952.
@icepy 同样遇到了你的这个安装问题,请问你是怎么解决的吖??( ⊙ o ⊙ )!
npm ERR! Darwin 14.0.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "-g" "hexo"
npm ERR! node v0.10.33
npm ERR! npm v2.1.7
npm ERR! path /usr/local/lib/node_modules/hexo/.gitmodules
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/hexo/.gitmodules'
npm ERR! { [Error: EACCES, unlink '/usr/local/lib/node_modules/hexo/.gitmodules']
npm ERR! errno: 3,
npm ERR! code: 'EACCES',
npm ERR! path: '/usr/local/lib/node_modules/hexo/.gitmodules' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/hexo/.gitmodules'
npm ERR! error rolling back { [Error: EACCES, unlink '/usr/local/lib/node_modules/hexo/.gitmodules']
npm ERR! error rolling back errno: 3,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/usr/local/lib/node_modules/hexo/.gitmodules' }
npm ERR! Please include the following file with any support request:
npm ERR! /Users/xiangwenwen/npm-debug.log
@qingqinghebiancao
感觉好像是墙的原因,我现在换了台Mac,开了VPN现在没有报错了。
@icepy 我有按照网上说的改镜像https://cnodejs.org/topic/4f9904f9407edba21468f31e,但是还是没安装成功%>_<%
@qingqinghebiancao 要不你开下VPN吧,在node-gyp那里会稍微等待会儿,因为在交检。
@qingqinghebiancao 其他步骤和官网的那个一样
@icepy 好的,那我试下!谢谢!
我使用这种方法可以了
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
然后
sudo npm -g install hexo-cli
使用 sudo npm install -g -unsafe-perm hexo 安装成功啦!
@code4a thanks ,it works for me that 'sudo npm install -g -unsafe-perm hexo'
sudo npm install -g -unsafe-perm hexo-cli <- works!
Most helpful comment
最后一种尝试,sudo chmod 777 /var/root 归于权限问题?不报错,安装成功。