tj / n

Node version management

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

export N_NODE_MIRROR failed to work

qiulang opened this issue · comments

Bug Report

export N_NODE_MIRROR failed to work, check the following result, n sill connects to https://nodejs.org/

langqiu@localhost ~ % export N_NODE_MIRROR=https://npmmirror.com/mirrors/node
langqiu@localhost ~ % sudo n 18
Password:
curl: (28) Failed to connect to nodejs.org port 443 after 151015 ms: Couldn't connect to server

  Error: failed to download version index (https://nodejs.org/dist/index.tab)

langqiu@localhost ~ % npm list -g
/usr/local/lib
├── corepack@0.17.0
├── n@9.1.0
├── npm@8.19.4
└── yarn@1.22.19

Configuration Details

$ n --version
v9.1.0

$ command -v node
/usr/local/bin/node

$ node -p process.platform
darwin

You need to tell sudo that you want to use the existing environment variables.

See #584 (comment) for Mac example.

Thanks 😅 Maybe you can add this to the manual, especially for mac users.