用原來的方法
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
nvm install node
npm install -g live-server
按照上述方法失敗,會一直卡住,或者安裝live-server時提示fsevents版本有問題,不兼容,嘗試更換node的源並沒有解決問題
新方式安裝成功
下載源碼node.js
https://nodejs.org/dist/v12.18.3/node-v12.18.3.tar.gz
進入node文件夾,
./configure
make && make install
node -v 檢查版本
npm config set registry=https://registry.npm.taobao.org使用淘寶鏡像
npm install -g npm
node -v 檢查版本
git clone https://github.com/tapio/live-server
cd live-server
npm install -g live-server