1. 程式人生 > >易學筆記-第2部分 Node.js入門指南/第5章 Node.js在幣圈流行麼

易學筆記-第2部分 Node.js入門指南/第5章 Node.js在幣圈流行麼

第2部分 Node.js入門指南/第5章 Node.js在幣圈流行麼/5.1 Node.js在開源社群很流行

  1. 概念:JavaScript大部分專案都是建立在Node.js平臺之上的
  2. 在Github上專案採用的語言統計,JavaScript排名很靠前

第2部分 Node.js入門指南/第5章 Node.js在幣圈流行麼/5.2 Node.js在幣圈也同樣流行

  1.  

第2部分 Node.js入門指南/第6章 Node.js讓前端開發像子彈飛一樣/6.1 專案需求


第2部分 Node.js入門指南/第6章 Node.js讓前端開發像子彈飛一樣/6.2 技術選型

  1. Node.js優點

第2部分 Node.js入門指南/第6章 Node.js讓前端開發像子彈飛一樣/6.3 Node.js簡介

  1. 概念:通俗的解釋就是,Node.js是一個可以讓您利用JavaScript語言開發應用的平臺,是構建執行在分散式裝置上的資料密集型實時程式的完美選擇。

第2部分 Node.js入門指南/第6章 Node.js讓前端開發像子彈飛一樣/6.4 開發步驟

  1. 安裝步驟參照: 快速搭建 Node.js 開發環境以及加速 npm - CNode技術社群
  2. 安裝指令碼
    1. 安裝nvm(node version manage):[[email protected] git]# curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.29.0/install.sh | bash

    2. 通過 nvm 安裝任意版本的 node:

      [[email protected] ~]# NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node nvm install 4

    3. 安裝npm(包管理工具)

      [[email protected] ~]#  npm --registry=https://registry.npm.taobao.org install koa

      [email protected] node_modules/koa

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected] ([email protected])

      ├── [email protected] ([email protected])

      ├── [email protected] ([email protected], [email protected])

      ├── [email protected] ([email protected])

      ├── [email protected] ([email protected])

      ├── [email protected] ([email protected])

      ├── [email protected] ([email protected])

      ├── [email protected] ([email protected])

      └── [email protected] ([email protected], [email protected])

      [[email protected] ~]#

    4. 安裝cnpm cli(馬上同步模組)

      [[email protected] ~]# npm --registry=https://registry.npm.taobao.org install cnpm -g

      npm WARN engine [email protected]: wanted: {"node":">= 6.0.0"} (current: {"node":"4.9.1","npm":"2.15.11"})

      npm WARN deprecated [email protected]: If using 2.x branch, please upgrade to at least 2.1.6 to avoid a serious bug with socket data flow and an import issue introduced in 2.1.0

      /root/.nvm/versions/node/v4.9.1/bin/cnpm -> /root/.nvm/versions/node/v4.9.1/lib/node_modules/cnpm/bin/cnpm

      [email protected] /root/.nvm/versions/node/v4.9.1/lib/node_modules/cnpm

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected]

      ├── [email protected] ([email protected])

      ├── [email protected] ([email protected])

      ├── [email protected] ([email protected])

      ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

      ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

      └── [email protected]

      [[email protected] ~]#

    5. [[email protected] ~]# cnpm sync koa connect mocha

      Start sync ["koa","connect","mocha"].

      sync koa, PUT https://registry.npm.taobao.org/koa/sync?publish=false&nodeps=false

      logurl: https://npm.taobao.org/sync/koa#logid=1297574

      [2018-05-28 22:22:25] user: anonymous, sync koa worker start, 1 concurrency, nodeps: false, publish: false, syncUpstreamFirst: false

      [2018-05-28 22:22:25] ----------------- Syncing koa -------------------

      [2018-05-28 22:22:26] [c#0] [koa] package(https://r.cnpmjs.org/koa) status: 200, dist-tags: {"latest":"2.5.1","next":"2.0.0-alpha.8","v1":"1.6.0"}, time.modified: 2018-04-26T17:11:31.000Z, unpublished: null, start...

      [2018-05-28 22:22:26]   [koa] found 0 missing star users

      [2018-05-28 22:22:26]   [koa] all versions are exists

      [2018-05-28 22:22:26]   [koa] no versions need to deleted

      [2018-05-28 22:22:26]   [koa] all 285 npm users exists

      [2018-05-28 22:22:26] [c#0] [koa] synced success, 0 versions:

      [2018-05-28 22:22:26] ----------------- Synced koa success -------------------

      [2018-05-28 22:22:26] [done] Sync koa package finished, 1 success, 0 fail

      Success: [ koa ]

      Fail: [  ]

      sync connect, PUT https://registry.npm.taobao.org/connect/sync?publish=false&nodeps=false

      logurl: https://npm.taobao.org/sync/connect#logid=1297576

      [2018-05-28 22:22:27] user: anonymous, sync connect worker start, 1 concurrency, nodeps: false, publish: false, syncUpstreamFirst: false

      [2018-05-28 22:22:27] ----------------- Syncing connect -------------------

      [2018-05-28 22:22:28] [c#0] [connect] package(https://r.cnpmjs.org/connect) status: 200, dist-tags: {"1.8":"1.9.0","latest":"3.6.6"}, time.modified: 2018-02-15T05:37:42.000Z, unpublished: null, start...

      [2018-05-28 22:22:28]   [connect] found 0 missing star users

      [2018-05-28 22:22:28]   [connect] all versions are exists

      [2018-05-28 22:22:28]   [connect] no versions need to deleted

      [2018-05-28 22:22:28]   [connect] all 262 npm users exists

      [2018-05-28 22:22:28] [c#0] [connect] synced success, 0 versions:

      [2018-05-28 22:22:28] ----------------- Synced connect success -------------------

      [2018-05-28 22:22:28] [done] Sync connect package finished, 1 success, 0 fail

      Success: [ connect ]

      Fail: [  ]

      sync mocha, PUT https://registry.npm.taobao.org/mocha/sync?publish=false&nodeps=false

      logurl: https://npm.taobao.org/sync/mocha#logid=1297589

      [2018-05-28 22:22:30] user: anonymous, sync mocha worker start, 1 concurrency, nodeps: false, publish: false, syncUpstreamFirst: false

      [2018-05-28 22:22:30] ----------------- Syncing mocha -------------------

      [2018-05-28 22:22:31] [c#0] [mocha] package(https://r.cnpmjs.org/mocha) status: 200, dist-tags: {"beta":"3.0.0-2","latest":"5.2.0"}, time.modified: 2018-05-18T23:36:59.000Z, unpublished: null, start...

      [2018-05-28 22:22:32]   [mocha] found 0 missing star users

      [2018-05-28 22:22:32]   [mocha] all versions are exists

      [2018-05-28 22:22:32]   [mocha] no versions need to deleted

      [2018-05-28 22:22:32]   [mocha] all 726 npm users exists

      [2018-05-28 22:22:32] [c#0] [mocha] synced success, 0 versions:

      [2018-05-28 22:22:32] ----------------- Synced mocha success -------------------

      [2018-05-28 22:22:32] [done] Sync mocha package finished, 1 success, 0 fail

      Success: [ mocha ]

      Fail: [  ]

      Sync all packages done, successed: ["koa","connect","mocha"], failed: []

      [[email protected] ~]#

    6. .