教程Web前端《Linux/Mac/vim相关知识》收集

node 和 npm 安装笔记

2017-01-17  本文已影响4592人  kelvin943

1.安装 homebrew 如下详细介绍参考 brew 官网 :

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

2.更新命令 : brew update

zhangqMacBook-Pro:~ kelvin$ brew update

Error: /usr/local is not writable. You should change the ownership

and permissions of /usr/local back to your user account:

sudo chown -R $(whoami) /usr/local 

按照提示需要使用sudo chown -R $(whoami) /usr/local 来更改权限

跟新完之后会提示Homebrew no longer needs to have ownership of /usr/local. If you wish you can return /usr/local to its default ownership with:sudo chown root:wheel /usr/local

按照提示使用sudo chown root:wheel /usr/local 改回原来的权限

3.测试brew是否安全可靠

zhangqMacBook-Pro:~ kelvin$ brew doctor

Your system is ready to brew.

4.安装 nodenpm

安装node : brew install node / 跟新:brew upgrade node

安装npm  : brew install npm

上一篇下一篇

猜你喜欢

热点阅读