# Node Mac上的安装方式
来源:互联网 发布:淘宝商品数据包下载 编辑:程序博客网 时间:2024/05/22 13:32
Node Mac上的安装方式
终端安装 homebrew
$ ruby -e "$(curl -fsSL https:/raw.githubusercontent.com/Homebrew/install/master/install)"
brew安装node
更新 brew
$ brew update
确保brew安全可靠
$ brew doctor
可能会出现如下情况 ,可针对逐条处理:
Warning: Some directories in /usr/local/share/man aren’t writable.
This can happen if you “sudo make install” software that isn’t managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.You should probably sudo chown -R $(whoami) them:
/usr/local/share/man/man5/usr/local/share/man/man7
将brew 添加到环境变量中,并保存 bash 或者 profile中
$ export PATH="usr/local/bin:$PATH"
brew 安装完成。如果在上面安装中出现如下错误信息
Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run brew link on these:
就需要如下操作
清除brew的link
$ brew cleanup
删除node文件,完全卸载node和npm
$ sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}
或者
$ sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* /usr/local/lib/dtrace/node.d ~/.npm ~/.node-gyp /opt/local/bin/node opt/local/include/node /opt/local/lib/node_modules
或者这样
在/usr/local/lib目录下,删除任何与node和 node_modules有关的目录;
在/usr/local/include 目录下,删除任何与node 和 node_modules有关的目录;
- 如果你是通过 brew install node 安装的node,则在终端执行brew uninstall node ,并在home目录下查找 local 或lib 或 include文件夹,删除任何与node 和 node_modules有关的目录;
- 在/usr/local/bin目录下,删除任何与 node 执行文件;
- 最后下载 nvm ,跟随它的介绍安装node。当然,你也可以通过npm来安装最新版本的Node。
通过brew 安装 node 和npm
$ brew link node$ brew uninstall node$ brew install node
测试
通过安装一个模块测试node 和npm 是否安装成功 express
$ npm install -g express
如果按照成功,那么 npm 和node就都安装成功了
查看版本
$ node -v$ npm -v
- # Node Mac上的安装方式
- mac上安装node
- MAC上安装node-canvas
- Mac上的Node安装及npm的使用
- mac 上node.js环境的安装与测试
- mac 上node.js环境的安装与测试
- mac 上node.js环境的安装与测试
- 通过源码编译的方式在fedora上安装node
- Mac OSX Lion上安装Node环境
- node.js在mac上环境安装与测试
- 在Mac上安装 jdk node npm ionic Cordova
- mac 安装node问题
- mac node安装
- mac node 安装
- mac 安装node.js
- mac 安装node环境
- Mac 安装 node.js
- Mac上MongoDB的安装
- 【POJ 3159】Candies
- Java支付宝支付集锦
- Opencv距离变换distanceTransform应用
- JAVA字符串格式化-String.format()的使用
- 微信唤起本地app进行导航
- # Node Mac上的安装方式
- hdu2050折线分割平面
- 服务器接受客户端发送的信息
- appcan的学习资源
- 项目管理——实践入门
- 日常学习2017.08.05
- 按之字形顺序打印二叉树
- 实例探索Java模式之路——模版方法模式
- Pixhawk之启动代码和入口函数(.mk、rcS、__start、hrt)