vscode在wsl中开发node应用,如何安装nvm?
git clone git@github.com:nvm-sh/nvm.git ~/.nvm
设置淘宝registry
npm config set registry https://registry.npm.taobao.org
~/.bashrc添加
export NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node
export NVM_IOJS_ORG_MIRROR=http://npm.taobao.org/mirrors/iojs
. ~/.nvm/nvm.sh
使配置生效
. ~/.bashrc
使用nvm
nvm list-remote
nvm ls
nvm install ...
nvm use ...
参考:
https://docs.microsoft.com/en-us/windows/nodejs/setup-on-wsl2#install-nvm-nodejs-and-npm
https://help.aliyun.com/document_detail/50775.html
https://npm.taobao.org/mirrors