Mac上面怎么更新node
发布于 2年前 作者 wldouglas 4587 次浏览

Mac terminal中更新node

23 回复

git clone git://github.com/tanepiper/SublimeText-Nodejs.git ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Nodejs

用Homebrew管理你的Mac 套件吧。

http://brew.sh/index_zh-cn.html

我的brew 出现各种问题,brew install 结果 Cannot write to /usr/local/Cellar

@wldouglas 權限問題吧

把那個目錄的權限用調整回你的使用者

chown -R user:group /usr/local/Cellar

@hankwang 还是不行那,纠结。ls -l显示用户是我de

@wldouglas 寫入權限呢?

sudo chmod a+w /usr/local/Cellar

列出你的 ls -l 看看

@hankwang ➜ Cellar git:(master) ✗ ls -l total 0 drwxr-xr-x 3 root wheel 102 Jun 25 12:49 gdbm drwxr-xr-x 3 root wheel 102 May 25 09:53 libevent drwxr-xr-x 3 root wheel 102 Jul 15 14:03 libgpg-error drwxr-xr-x 3 root wheel 102 Jul 15 14:03 libksba drwxr-xr-x 3 root wheel 102 Jul 14 10:22 mongodb drwxr-xr-x 3 root wheel 102 May 26 10:50 node drwxr-xr-x 3 root wheel 102 May 29 14:02 p7zip drwxr-xr-x 3 root wheel 102 Jun 25 12:49 pcre drwxr-xr-x 3 root wheel 102 Jul 8 20:12 pkg-config drwxr-xr-x 3 root wheel 102 Jul 8 20:24 python drwxr-xr-x 3 root wheel 102 Jul 8 20:21 readline drwxr-xr-x 3 root wheel 102 Jul 8 20:21 sqlite drwxr-xr-x 3 root wheel 102 May 25 09:49 tomcat drwxr-xr-x 3 root wheel 102 May 25 09:51 unrar drwxr-xr-x 3 root wheel 102 May 29 15:57 vim drwxr-xr-x 3 root wheel 102 May 25 09:45 wget drwxr-xr-x 3 root wheel 102 Jun 25 13:41 xz drwxr-xr-x 3 root wheel 102 Jun 25 12:51 zsh

@wldouglas ➜ local git:(master) ✗ sudo brew install wget
Warning: wget-1.14 already installed 但是这个和brew update有什么关系?

@wldouglas 既然你是用root, 那用

sudo brew update
sudo brew install node

@hankwang Aborting Error: Failure while executing: git checkout -q master 这是报错

cd /usr/local
git fetch origin
git reset --hard origin/master

then try again.

it works,but how can I update the package like doing this in ubuntu : sudo apt-get install update

@wldouglas

update packages list

sudo brew update

if you want to install/upgrade node, just do this as your case:

sudo brew install node
sudo brew upgrade node

@hankwang it really do work thank you very much

直接下载官方的安装包, 安装就行了

我通过命令行已经安装了,是想通过通过brew来升级哈,不过问题已经解决拉,还是谢谢ha。

我用的是homebrew

是升级的问题哈

推荐用brew, 比port好用

怎么还不明白包管理机制哪

nvm install 0.10.16 可以安装/管理不同版本的node 同时方便你自由切换版本

github自己找下nvm或者n 这都要做伸手党劝你也不要学编程了

use https://github.com/visionmedia/n that’s the easiest way to manage node versions.

回到顶部