当前位置:   article > 正文

前端开发环境相关 node npm git_pnpm设置代理

pnpm设置代理

node.js版本管理工具nvm-windows

⭐⭐卸载所有已安装的Node !!⭐⭐

在安装NVM for Windows之前卸载任何现有版本的Node.js(否则你会有冲突的版本)。删除任何可能存在的Node.js安装目录(例如,%ProgramFiles%\nodejs)。NVM生成的符号链接不会覆盖现有的(甚至是空的)安装目录。

// GitHub链接
https://github.com/nvm-sh/nvm
https://github.com/coreybutler/nvm-windows
  • 1
  • 2
  • 3
# 使用示例
# 安装指定的node.js版本
nvm install 16.16.0

# 安装完成之后,需要使用才能生效
nvm use 16.16.0

# 查看当前已安装的node.js版本,带*号的是正在使用的
nvm ls
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

解决端口占用问题kill-port

npm包地址https://www.npmjs.com/package/kill-port

# 安装依赖
npm i kill-port

# 停用 指定端口
npx  kill-port 8000
  • 1
  • 2
  • 3
  • 4
  • 5

解决git编码问题

git config --global core.autocrlf true
  • 1

解决pnpm不能再websoket编辑器shell中运行问题

# powershell 脚本安全策略
set-ExecutionPolicy RemoteSigned
  • 1
  • 2

npm配置镜像

# 临时淘宝镜像
npm --registry https://registry.npm.taobao.org install express

# 永久淘宝镜像
npm config set registry https://registry.npm.taobao.org

# 查看
npm config get registry

# npm配置代理
 npm config set proxy http://server:port
 npm config set https-proxy http://server:port
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12

cnpm安装

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

# test install
cnpm i express
  • 1
  • 2
  • 3
  • 4
  • 5

git配置代理

# 使用以下命令查看git配置,看是否有配置代理
git config --list

# 使用以下命令配置http代理(http://127.0.0.1:123是我的代理地址)
git config --global http.proxy http://127.0.0.1:123

# 使用以下命令配置https代理
git config --global https.proxy https://127.0.0.1:123

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9

node-sass 和 node.js 对应关系

https://github.com/sass/node-sass
  • 1

在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Li_阴宅/article/detail/760314
推荐阅读
相关标签
  

闽ICP备14008679号