Allen's blog Allen's blog
首页
面经
算法 (opens new window)
分类

Allen

前端CV工程师
首页
面经
算法 (opens new window)
分类
  • Javascript

  • TypeScript

  • CSS

  • Vue

  • React

  • 框架和构建工具

  • 工具库

  • 常见业务场景

  • Bug

    • backgroud-image背景图展示不出来
    • Vue基础组件库引入样式失效
    • 代码规范工具配置各种错误集合
    • yarn link报错
      • 解决办法一
      • 解决办法二
    • mouseover等事件不触发
    • iframe在chrome浏览器无痕模式出错
    • execSync执行命令无效
    • 在nuxt项目中pnpm link加载不了模块
    • 启动web项目提示无端口权限
  • 项目实战

  • 前端
  • Bug
Allen
2023-03-27
目录

yarn link报错

网上翻了一些文章,说 npm link 和 yarn link 都差不多,但是我实际体验下来,yarn link 速度会快一些。

在开发工具包的时候,经常需要在项目中测试工具包的功能是否完善,因此需要在发布版本之前进行本地测试,本地是可以输出一个 package 的,但是太麻烦了,改几行代码又重新打包一次,显然不够优雅,因此需要用到 npm link/yarn link。

在使用 yarn link 的时候报错:

warning There's already a package called "xxx" registered. This command has had no effect. If this command was run in another folder with the same name, the other folder is still linked. Please run yarn unlink in the other folder if you want to register this folder.
1

# 解决办法一

找到之前那个注册为全局链接的文件夹,执行yarn unlink xxx了。

# 解决办法二

不巧的是,我开发的时候,文件夹管理得比较乱,已经找不到原来的文件夹

可以找到 yarn 在系统中的存放软链接的目录,删除这个软链接,具体地址在:C:\Users\lxc\AppData\Local\Yarn\bin和C:\Users\lxc\AppData\Local\Yarn\Data\link

上次更新: 2023/12/16, 09:22:46
代码规范工具配置各种错误集合
mouseover等事件不触发

← 代码规范工具配置各种错误集合 mouseover等事件不触发→

最近更新
01
rollup使用配置文件rollup.config.ts打包
12-08
02
package.json导出类型
12-08
03
关键问题方案
11-17
更多文章>
Theme by Vdoing | Copyright © 2023-2023 Allen | Github
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式