nvm的使用
常用问题
<!-- Newer Node.js requires the following to avoid an "ERR_OSSL_EVP_UNSUPPORTED"
error when WebPack attempts to use its default hash (MD4) for content hashing -->
解决:设置环境变量
export NODE_OPTIONS=--openssl-legacy-provider
安装
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
安装最新的lts
nvm install --lts
参考
配置源
安装好nvm后,配置这个源
export NVM_NODEJS_ORG_MIRROR=https://cdn.npmmirror.com/binaries/node
npm配置阿里源
npm config set registry https://registry.npmmirror.com
npm config get registry