搜尋

首頁  >  問答  >  主體

在ubuntu上装了node.js后,npm install hexo-cli -g 提示没装npm,怎么办

在ubuntu上装了node.js后,npm install hexo-cli -g 提示没装npm,怎么办

高洛峰高洛峰2875 天前597

全部回覆(2)我來回復

  • 大家讲道理

    大家讲道理2017-04-17 13:10:06

    是不是nodejs 裝殘了?

    你可以透過
    npm config get prefix
    查看全域安裝路徑,
    透過
    npm config set prefix=路徑

    回覆
    0
  • 阿神

    阿神2017-04-17 13:10:06

    如果使用apt-get install nodejs npm 需要單獨裝
    官方有安裝介紹

    NOTE: If you are using Ubuntu Precise or Debian Wheezy, you might want to read about running Node.js >= 4.x on older distros.
    curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash - sudo apt-get install -y nodejs
    Alternatively, for Node.js v6:
    curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash - sudo apt-get install -y nodejs
    

    回覆
    0
  • 取消回覆