添加配置~/.bash_profile

alias cnpx='NPM_CONFIG_REGISTRY=https://registry.npm.taobao.org/ npx'

参考
npx 如何使用淘宝镜像