npm笔记

NPM

npm install -g cnpm --registry=https://registry.npm.taobao.org

CNPM

npm install -g cnpm --registry=https://registry.npm.taobao.org

NVM

查看可下载node版本列表(windows):	nvm list available
 
切换不同版本: nvm use 版本号

注意: 以下为必操作
// 在setting 文件加, 避免node跟npm版本问题、node不带npm问题
node_mirror: https://npm.taobao.org/mirrors/node/
npm_mirror: https://npm.taobao.org/mirrors/npm/

npm配置相关

镜像源链接切换
国内镜像源:
npm config set registry http://registry.npm.taobao.org

cnpm源
npm install -g cnpm --registry=https://registry.npm.taobao.org

查看镜像源使用状态:
npm get registry

全局切换官方镜像源:
npm config set registry http://www.npmjs.org
npm config set registry http://registry.npmjs.org

安装私有包

普通的()
    先安装私有npm包:npm install  <npm包名> --registry=<npm包源>
    然后安装公共 npm 包
    
    或
    npm --registry https://registry.npm.taobao.org install <registry>
    
需要先注册的(例子)
    npm set registry http://100.101.200.23:4873/
    npm adduser --registry http://100.101.200.23:4873/
    npm profile set password --registry http://100.101.200.23:4873/

nrm

使用nrm切换镜像源
下载: nrm:npm install -g nrm
查看可切换的镜像源: nrm ls
切换淘宝镜像源:nrm use taobao  
 	// (*表示正在使用的镜像源)
     * npm -------- https://registry.npmjs.org/
      yarn ------- https://registry.yarnpkg.com/
      cnpm ------- http://r.cnpmjs.org/
      taobao ----- https://registry.npm.taobao.org/
      nj --------- https://registry.nodejitsu.com/
      npmMirror -- https://skimdb.npmjs.com/registry/
      edunpm ----- http://registry.enpmjs.org/

使用梯子安装: npm config set proxy=http://127.0.0.1:9999
卸载梯子: npm config delete proxy
定制源
定制的源()
    特别适用于添加企业内部的私有源,执行命令 nrm add <registry> <url>,其中 reigstry 为源名,url 为源的路径
添加: nrm add <registry> http://192.168.0.127:8527/repository/npm-public/
移除: nrm del <registry>
测试延迟: nrm test

代理

设置代理
git设置

直接代理

git config --global http.proxy http://127.0.0.1:80
git config --global https.proxy https://127.0.0.1:80

授权代理

git config --global http.proxy http://username:password@127.0.0.1:80
git config --global https.proxy https://username:password@127.0.0.1:80

取消代理

git config --global --unset http.proxy
git config --global --unset https.proxy

npm设置
#直接代理
npm config set proxy http://127.0.0.1:80
npm config set https-proxy https://127.0.0.1:80
#授权代理
npm config set proxy http://username:password@127.0.0.1:80
npm config set https-proxy https://username:password@127.0.0.1:80

souceTree使用问题
拉取、提交提示权限问题

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值