安装tldr

安装tldr

  1. 执行命令安装tldr

    sudo apt-get install nodejs

    sudo apt-get install npm

    sudo npm install -g tldr

    安装失败,提示:

    WARN engine tldr@3.3.7: wanted: {"node":">=6.12.0"} (current: {"node":"4.2.6","npm":"3.5.2"})
    WARN engine tldr@3.3.7: wanted: {"node":">=6.12.0"} (current: {"node":"4.2.6","nloadDep:ora → 200         ▀ ╢██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
    WARN engine chalk@4.1.2: wanted: {"node":">=10"} (current: {"node":"4.2.6","npm":"3.5.2"})
    WARN engine fs-extra@9.1.0: wanted: {"node":">=10"} (current: {"node":"4.2.6","nloadDep:ora → addNamed    ▐ ╢██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
    WARN engine ora@5.4.1: wanted: {"node":">=10"} (current: {"node":"4.2.6","npm":"loadDep:ora → fetch       ▀ ╢██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
    WARN engine marked@2.1.3: wanted: {"node":">= 10"} (current: {"node":"4.2.6","nploadDep:ora → 200         ▄ ╢██████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
    WARN engine commander@6.2.1: wanted: {"node":">= 6"} (current: {"node":"4.2.6","loadDep:supports-color →  ▄ ╢███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
    WARN engine supports-color@7.2.0: wanted: {"node":">=8"} (current: {"node":"4.2.6","npm":"3.5.2"})
    WARN engine ansi-styles@4.3.0: wanted: {"node":">=8"} (current: {"node":"4.2.6",loadDep:color-convert → 2 ▄ ╢███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
    WARN engine color-convert@2.0.1: wanted: {"node":">=7.0.0"} (current: {"node":"4loadDep:has-flag → 200    ▄ ╢███████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
    WARN engine has-flag@4.0.0: wanted: {"node":">=8"} (current: {"node":"4.2.6","nploadDep:universalify → ge ▌ ╢████████████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░╟
    WARN engine universalify@2.0.0: wanted: {"node":">= 10.0.0"} (current: {"node":"npm ERR! Linux 4.15.0-142-generic
    npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "tldr"
    npm ERR! node v4.2.6
    npm ERR! npm  v3.5.2
    npm ERR! code EMISSINGARG
    
    npm ERR! typeerror Error: Missing required argument #1
    npm ERR! typeerror     at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
    npm ERR! typeerror     at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
    npm ERR! typeerror     at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
    npm ERR! typeerror     at /usr/share/npm/lib/install/deps.js:457:7
    npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
    npm ERR! typeerror     at /usr/share/npm/lib/fetch-package-metadata.js:37:12
    npm ERR! typeerror     at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
    npm ERR! typeerror     at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
    npm ERR! typeerror     at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
    npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
    npm ERR! typeerror This is an error with npm itself. Please report this error at:
    npm ERR! typeerror     <http://github.com/npm/npm/issues>
    
    npm ERR! Please include the following file with any support request:
    npm ERR!     /home/lux/npm-debug.log
    
    

    ​ 错误原因:nodejs版本太低

  2. 执行命令,升级nodejs

    sudo apt-get install nodejs-legacy

    sudo npm install -g n

    sudo n latest

    sudo node -v查看nodejs版本号

    升级失败:提示

    node: /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by node)
    node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.25' not found (required by node)
    node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by node)
    
    

    我用的是16.4这个版本的nodejs不支持

  3. 执行命令

    sudo n stable

    sudo node -v

    查看版本号正常v16.16.0

  4. 安装tldr

    sudo npm install -g tldr

  5. 更新tldr

    tldr --update

  6. 尝试使用tdlr

    tdlr tar

你可能感兴趣的:(Linux学习过程笔记,npm)