zoukankan      html  css  js  c++  java
  • Mac下通过brew安装指定版本的nodejs

    一、安装brew

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

    二、安装nodejs

    运行brew install node 即可,但是这样安装的node是最新node,本人安装后是node6.X,node6.X对一些就模块已经不支持了,比如graceful-fs,导致安装一些包的时候,无法运行,就会出现类似 (node:7844) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version 的提示。

    三、安装指定版本的node

    旧版的brew,可以通过brew versions nodejs,运行后会提示 Error: The `versions` command is no longer supported. brew versions已废弃掉了。

    1、需要安装homebrew-version

    brew tap homebrew/versions

    2、查看可安装的node版本

    brew install homebrew/versions/node

    3、选择按一个node的版本

    brew install homebrew/versions/node5

    这样就可以成功安装node5.x版本

    欢迎大家加入前端交流群一起讨论:498524034

  • 相关阅读:
    struct pack unpack
    读书笔记 第四章&第五章
    The Sieve of Eratosthens(爱拉托逊斯筛选法)
    2013年3月百度之星A题
    2013年3月百度之星B题
    好句子
    BFS 与 DFS
    记录本
    HDU 2028 如何计算最小公倍数?
    HDU 2015 偶数求和 解题报告
  • 原文地址:https://www.cnblogs.com/shiyunfront/p/7337783.html
Copyright © 2011-2022 走看看