用原来的方法
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