centos 安装

  • rpm
  • yum (install | clean all) 如果版本安装有问题,记得按照官方distribution的文档里面写的,做好处理,不然会被缓存影响
  • 或者直接通过nvm安装 - https://github.com/nvm-sh/nvm/tree/v0.39.3
    1
    2
    3
    4
    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
    wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
    export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
    [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
  • centos7不支持nodejs18的安装,会提示依赖有问题,具体可见github上面的issue
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    机器版本:
    CentOS Linux release 7.9.2009 (Core)
    用户issue:
    https://github.com/nodejs/node/issues/43246
    官方支持声明:
    Supported CentOS versions:
    * CentOS 7 (64-bit) WARNING: BUILD SYSTEM CURRENTLY BROKEN FOR NODEJS 18+
    * CentOS 8 (64-bit)
    * CentOS 8 Stream (64-bit)

    因已知及潜在兼容性问题,和官方支持声明,所以安装16+版本,提供nvm进行切换

    安装:
    走rpm装18的时候的报错

    curl -fsSL https://rpm.nodesource.com/setup_lts.x | bash -
    Error: Package: 2:nodejs-18.14.2-1nodesource.x86_64 (nodesource)
    Requires: libstdc++.so.6(GLIBCXX_3.4.21)(64bit)
    Error: Package: 2:nodejs-18.14.2-1nodesource.x86_64 (nodesource)
    Requires: libm.so.6(GLIBC_2.27)(64bit)
    Error: Package: 2:nodejs-18.14.2-1nodesource.x86_64 (nodesource)
    Requires: libstdc++.so.6(GLIBCXX_3.4.20)(64bit)
    Error: Package: 2:nodejs-18.14.2-1nodesource.x86_64 (nodesource)
    Requires: libstdc++.so.6(CXXABI_1.3.9)(64bit)
    Error: Package: 2:nodejs-18.14.2-1nodesource.x86_64 (nodesource)
    Requires: libc.so.6(GLIBC_2.28)(64bit)
    You could try using --skip-broken to work around the problem
    You could try running: rpm -Va --nofiles --nodigest

latest

项目经验

node服务项目
electron项目

globals

Module

querystring

基础架构(原理)

api

vm

npm

easy_sock

https://www.npmjs.com/package/protocol-buffers

slides - ryan dahl 的一系列在conf里面的演讲,不同阶段,可以去YTB上面看

perf_hooks

perf_hooks
解决这个报warining的问题
先新建一个项目,引入perf_hooks,没有任何问题
看了不同版本的代码,发现引入的问题,升级了版本即可
http://nodejs.cn/api/perf_hooks.html