簡體   English   中英

如何在Ubuntu 15.10上通過命令安裝Node.js

[英]how to install nodejs through command on Ubuntu 15.10

我無法安裝nodejs最新版本,但出現錯誤。 我有一個用於安裝nodejs的fab文件。 以下是我使用的定義。

def install_nodejs():
    cmds = ['sudo apt-get remove --purge nodejs npm',
            'wget http://deb.nodesource.com/setup -O /tmp/setup.sh',
            '/bin/bash -x /tmp/setup.sh']
    for cmd in cmds:
        sudo(cmd)

    packages = ['python-software-properties', 'g++', 'make', 'ruby-compass', 'nodejs']
    cuisine.package_ensure(packages)

在cmd上:

fab install_nodejs -H admin@core.small.team

錯誤:

echo '## Your distribution, identified as "wily", is not currently supported, please contact NodeSource at https://github.com/nodesource/distributions/issues if you think this is incorrect or would like your distribution to be considered for support'

Fatal error: sudo() received nonzero return code 1 while executing!

Requested: /bin/bash -x /tmp/setup.sh
Executed: sudo -S -p 'sudo password:'  /bin/bash -l -c "/bin/bash -x /tmp/setup.sh"

安裝特定版本的nodeJ(例如當前的TLS 10.15.3)

您可以使用NVM(節點版本管理器):

  1. curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh -o install_nvm.sh
  2. bash install_nvm.sh
  3. nvm安裝10.15.3

然后享受。 祝好運

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM