Blame
|
1 | # Node.js 代理配置 |
||||||
|
2 | |||||||
|
3 | ## npm 代理配置 |
||||||
|
4 | |||||||
|
5 | ```sh |
||||||
| 6 | npm config set proxy http://127.0.0.1:7890 # 设置代理 |
|||||||
| 7 | ``` |
|||||||
| 8 | ||||||||
| 9 | ## 设置镜像 |
|||||||
| 10 | ||||||||
|
11 | 设置 |
||||||
| 12 | ||||||||
| 13 | ```sh |
|||||||
| 14 | npm config set registry https://registry.npmmirror.com/ |
|||||||
| 15 | yarn config set registry https://registry.npmmirror.com/ |
|||||||
| 16 | pnpm config set registry https://registry.npmmirror.com/ |
|||||||
| 17 | ``` |
|||||||
| 18 | ||||||||
| 19 | 查看 |
|||||||
| 20 | ||||||||
| 21 | ```sh |
|||||||
| 22 | npm config get registry |
|||||||
| 23 | yarn config get registry |
|||||||
| 24 | pnpm config get registry |
|||||||
| 25 | ``` |
|||||||
| 26 | ||||||||
|
27 | ## 常用二进制包镜像设置 |
||||||
| 28 | ||||||||
| 29 | ```sh |
|||||||
| 30 | npm set sass_binary_site https://cdn.npmmirror.com/binaries/node-sass # node-sass 二进制包镜像 |
|||||||
| 31 | npm set chromedriver_cdnurl https://cdn.npmmirror.com/binaries/chromedriver # chromedriver 二进制包镜像 |
|||||||
| 32 | npm set operadriver_cdnurl https://cdn.npmmirror.com/binaries/operadriver # operadriver 二进制包镜像 |
|||||||
| 33 | npm set phantomjs_cdnurl https://cdn.npmmirror.com/binaries/phantomjs # phantomjs 二进制包镜像 |
|||||||
| 34 | npm set fse_binary_host_mirror https://cdn.npmmirror.com/binaries/fsevents # fsevents 二进制包 |
|||||||
| 35 | npm set electron_mirror https://cdn.npmmirror.com/binaries/electron/ # electron 二进制包镜像 |
|||||||
| 36 | ``` |
|||||||
| 37 | ||||||||
| 38 | ### node-sass |
|||||||
|
39 | |||||||
| 40 | ```sh |
|||||||
|
41 | npm config set sass_binary_site https://cdn.npmmirror.com/binaries/node-sass/ |
||||||
| 42 | yarn config set sass_binary_site https://cdn.npmmirror.com/binaries/node-sass/ |
|||||||
| 43 | pnpm config set sass_binary_site https://cdn.npmmirror.com/binaries/node-sass/ |
|||||||
|
44 | ``` |
||||||