export N_NODE_MIRROR=https://npm.taobao.org/mirrors/node & sudo n 10.16.3
it still fetch node from https://nodejs.org
You need to tell sudo that you want to use the existing environment variables.
For example, on Mac looks like:
export N_NODE_MIRROR=https://npm.taobao.org/mirrors/node
sudo -E n 10.16.3
From sudo man page:
-E, --preserve-env
Indicates to the security policy that the user wishes to preserve their existing
environment variables. The security policy may return an error if the user does
not have permission to preserve the environment.
ok thanks for your help
maybe you should add those to readme.md (?)
You need to tell sudo that you want to use the existing environment variables.
For example, on Mac looks like:
export N_NODE_MIRROR=https://npm.taobao.org/mirrors/node sudo -E n 10.16.3From sudo man page:
-E, --preserve-env
Indicates to the security policy that the user wishes to preserve their existing
environment variables. The security policy may return an error if the user does
not have permission to preserve the environment.
Thanks!
Most helpful comment
You need to tell sudo that you want to use the existing environment variables.
For example, on Mac looks like:
From sudo man page: