NPM 初始化

本文最后更新于:2024年3月18日 凌晨

NPM 初始化

安装

1
2
3
4
5
$ brew install node@10
# OR
$ sudo apt-get install nodejs
# OR
$ sudo yum install nodejs

升级

1
$ npm install npm -g
  • 查看NPM版本号。
1
$ npm --version

代理配置

设置代理

1
2
3
4
5
6
$ npm config set proxy http://server:port
$ npm config set https-proxy http://server:port

# 如果需要认证的话可以这样设置:
$ npm config set proxy http://username:password@server:port
$ npm confit set https-proxy http://username:password@server:port

取消代理

1
2
$ npm config delete proxy
$ npm config delete https-proxy

本博客所有文章除特别声明外,均采用 CC BY-SA 4.0 协议 ,转载请注明出处!