zoukankan      html  css  js  c++  java
  • Ubuntu 13.10 下安装node

    1、首先更新Ubuntu在线包:sudo apt-get update && sudo apt-get dist-upgrade,

    2、默认Ubuntu已经安装python的,具体版本需要查看:python -V(v大写),第一步已经把python更新了

    node要求是2.6以上版本....

    3.、安装其他依赖包:
    sudo apt-get install g++ curl libssl-dev apache2-utils

    4、去http://www.nodejs.org/官网下载node最新版本,目前是v0.10.26(其中Ubuntu资源里面是10.15,不是最新).

    5、解压:tar xvf node-v0.10.26.tar.gz

    6、进入:cd node-v0.10.26 目录

    7、./configure

    8、 make(时间比较久)

    9、make install

    10、检查是否成功安装,输入命令:node -v,出现相应版本号

    11、小牛试刀,新建一个Hello.js文件,放入下面内容:

    var http = require('http');
    http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/plain'});
    res.end('Hello World
    ');
    }).listen(1337, '127.0.0.1');
    console.log('Server running at http://127.0.0.1:1337/');

    node Hello.js

  • 相关阅读:
    Netty之Channel*
    Netty之ByteBuf
    Spark On Yarn的各种Bug
    外网无法访问hdfs文件系统
    报错:Unsupported field: HourOfDay
    启动spark-shell --master yarn的bug
    KMP算法思路
    单例模式的正确实现
    redis 持久化
    记一次MacOs降级过程
  • 原文地址:https://www.cnblogs.com/milian/p/3630526.html
Copyright © 2011-2022 走看看