Mac terminal中更新node
git clone git://github.com/tanepiper/SublimeText-Nodejs.git ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/Nodejs
用Homebrew管理你的Mac 套件吧。
我的brew 出现各种问题,brew install 结果 Cannot write to /usr/local/Cellar
@hankwang 还是不行那,纠结。ls -l显示用户是我de
@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
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
直接下载官方的安装包, 安装就行了
nvm
mac port
我通过命令行已经安装了,是想通过通过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.
$ git clone git@github.com:creationix/nvm.git ~/.nvm
$ source ~/.nvm/nvm.sh
# 安装
$ nvm install v0.12.0
# 显示当前本地安装的所有 Node.js
$ nvm ls
# 显示服务器所有可用的 Node.js
$ nvm ls-remote
# 本地可用的 Node.js 中使用 0.12.0
$ nvm use 0.12.0
# 设置每次启动默认版本
$ nvm alias default 0.12.0