学习笔记学习笔记
主站博客
面试
前端
开发工具
Cesium
GitHub
主站博客
面试
前端
开发工具
Cesium
GitHub
  • 开发工具
  • git

    • 常用设置
  • js

    • 直接在Chrome控制台加载js
    • Next.js

      • vscode中debug调试nextjs配置.md
  • npm

    • npm常用命令和配置(包括yarn、pnpm等)
  • vi

    • vi常用命令

npm常用命令和配置(包括yarn、pnpm等)

设置不同的源、镜像

yarn、pnpm如果没有单独配置,回先读取npm的配置内容

npm config set registry https://registry.npmjs.org 
npm config set registry https://registry.npmmirror.com
npm config set registry https://registry.npm.aliyun.com
yarn config set registry  https://registry.npmmirror.com
yarn config set registry registry.npm.aliyun.com
yarn config set registry https://registry.npmjs.org 
yarn config get registry

常用npm源

淘宝镜像: registry.npm.taobao.org/
cnpmjs镜像: registry.npmjs.com.cn/
华为云镜像: https://mirrors.huaweicloud.com/repository/npm/
阿里云镜像: registry.npm.aliyun.com/
npm官方镜像: registry.npmjs.org/

查看所有配置

npm config list

查看npm link 的项目详情

打开对应目录,查看相应软连接

npm ls -g --depth=0 --link=true # npm  
ls ~/AppData/Local/Yarn/Data/link/ # yarn
在 GitHub 上编辑此页
上次更新:
贡献者: 国wei