zoukankan      html  css  js  c++  java
  • ubuntu install node0.8.9 to the current user

    1.to the current user.

    ## log install node.0.8.9 to /home/zhng/devHome/node/0.8.9
    #0. prepare
    sudo apt-get install g++
    sudo apt-get install curl
    #1. download
    wget http://nodejs.org/dist/v0.8.9/node-v0.8.9.tar.gz
    #2. tar
    tar -zvxf http://nodejs.org/dist/v0.8.9/node-v0.8.9.tar.gz
    #3. before make, update configure
    cd node-v0.8.9
    ./configrue --prefix=${HOME}/devHome/node/0.8.9
    #4. make
    make
    #5. install
    make install
    #6. set current user's env
    echo 'export PATH=${HOME}/devHome/node/0.8.9/bin:${PATH}' >> ~/.bashrc
    #7. make the env come to force
    . ~/.bashrc
    #8. install npm
    ##https://npmjs.org/doc/README.html
    ##Fancy Install (Unix)
    ###here's a pretty robust install script at https://npmjs.org/install.sh. You can download that and run it
    curl https://npmjs.org.org/install.sh | sh
    #9. test npm
    npm install hexy

    2.js check.

    #1. douban-jslint
    ##https://github.com/kejun/Douban-JSLint
    ##without the option g. it's installed in the current directory.
    npm install -g http://github.com/kejun/Douban-JSLint/tarball/master
    #2 install closure-lint
    ## https://developers.google.com/closure/utilities/docs/linter_howto?hl=zh-TW
    ##2.1. python easy_install
    sudo apt-get install python-setuptools
    ##2.2
    sudo easy_install http://closure-linter.googlecode.com/files/closure_linter-latest.tar.gz

    nodejs's Helloworld

    3. Hello World.

    // Helloworld.js
    // nodejs's Helloworld.js
    console.log('Helloworld');

    4.nodejs's simple http server.

    // server1.js
    // nodejs's simple server.
    
    var http = require('http');
    
    http.createServer(function(request, response) {
     //reponse's head
      response.writeHead(200, {'Content-TYpe': 'text/html'});
      response.write('<h1>Node.js</h1>');
     //say it's the end.
      response.end('<p>a simple http server</p>');
    } ).listen(3000);
    cnsole.log('http server is listending at port 3000.');

    5.....

  • 相关阅读:
    unix操作系统一些笔记
    安装SQL SERVER2008 R2出现的几个问题
    js中的类型和函数参数传递类型问题
    js一些要点
    百度2015年前端笔试题(南京区域)
    js 函数中的 this 问题
    html细节
    前后台读取Web.config中的值的方法
    使用的 SQL Server 版本不支持数据类型“datetime2”.
    物料主数据MRP4中的独立/集中
  • 原文地址:https://www.cnblogs.com/zhng/p/2699697.html
Copyright © 2011-2022 走看看