`docsify` fails under yarn pnp strict mode due to missing `ansi-colors` dependency
还没有人认领这个 Issue。
评估
- 难度
- 1/5
- 预计耗时
- 1 小时以内
- 新手友好度
- 55/100
- Issue 类型
- 缺陷
- 描述清晰度
- 描述清楚
- 活跃度
- 停滞
- 技术栈
- javascript, nodejs
调研方向
先从 lib/commands/init.js 开始,确认直接 require ansi-colors,然后检查 package.json 和现有的 package-lock.json 版本。添加缺失的依赖项,并在 Yarn Plug'n'Play 严格模式下运行 yarn run docsify;完成的标准是该命令在没有未声明依赖项错误的情况下启动。
由索引模型根据 Issue 内容生成。
描述
Yarn (v2/3) by default operates in a strict Plug'n'Play mode which does not allow directly loading indirect dependencies.
lib/commands/init.js directly requires ansi-colors, but it's not listed in package.json.
yarn run docsify, therefore, fails (even if docsify-cli is correctly registered in package.json).
Adding "ansi-colors": "^4.1.1" to dependencies should be enough (I chose that version because it's what's already in package-lock.json from an indirect dependency).
$ yarn run docsify
/Users/tlilley/projects/veatech/sbx/smithy/.pnp.cjs:11796
throw firstError;
^
Error: docsify-cli tried to access ansi-colors, but it isn't declared in its dependencies; this makes the require call ambiguous and unsound.
Required package: ansi-colors
Required by: docsify-cli@npm:4.4.4 (via /Users/tlilley/projects/veatech/sbx/smithy/.yarn/cache/docsify-cli-npm-4.4.4-3d7dbcc799-2f72ff07d0.zip/node_modules/docsify-cli/lib/commands/)
Require stack:
- /Users/tlilley/projects/veatech/sbx/smithy/.yarn/cache/docsify-cli-npm-4.4.4-3d7dbcc799-2f72ff07d0.zip/node_modules/docsify-cli/lib/commands/init.js
- /Users/tlilley/projects/veatech/sbx/smithy/.yarn/cache/docsify-cli-npm-4.4.4-3d7dbcc799-2f72ff07d0.zip/node_modules/docsify-cli/lib/index.js
- /Users/tlilley/projects/veatech/sbx/smithy/.yarn/cache/docsify-cli-npm-4.4.4-3d7dbcc799-2f72ff07d0.zip/node_modules/docsify-cli/bin/docsify
at require$$0.Module._resolveFilename (/Users/tlilley/projects/veatech/sbx/smithy/.pnp.cjs:11795:13)
at require$$0.Module._load (/Users/tlilley/projects/veatech/sbx/smithy/.pnp.cjs:11645:42)
at Module.require (node:internal/modules/cjs/loader:1157:19)
at require (node:internal/modules/helpers:119:18)
at Object.<anonymous> (/Users/tlilley/projects/veatech/sbx/smithy/.yarn/cache/docsify-cli-npm-4.4.4-3d7dbcc799-2f72ff07d0.zip/node_modules/docsify-cli/lib/commands/init.js:10:16)
at Module._compile (node:internal/modules/cjs/loader:1275:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1329:10)
at require$$0.Module._extensions..js (/Users/tlilley/projects/veatech/sbx/smithy/.pnp.cjs:11839:33)
at Module.load (node:internal/modules/cjs/loader:1133:32)
at require$$0.Module._load (/Users/tlilley/projects/veatech/sbx/smithy/.pnp.cjs:11676:14)
Node.js v19.8.1
- 主要语言
- JavaScript
- 星标
- 781
- 派生
- 166
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
docsifyjs/docsify-cli 的其他 Issue
-
难度 4/5 3-5 天 新手友好度 45/100
docsifyjs/docsify-cli#253 ·
-
难度 5/5 一周以上 新手友好度 25/100
docsifyjs/docsify-cli#229 · 1 条评论 ·
-
enhancement
难度 3/5 1-2 天 新手友好度 35/100
docsifyjs/docsify-cli#193 ·
-
难度 3/5 1-2 天 新手友好度 35/100
docsifyjs/docsify-cli#188 ·
-
I would like to know why generating multi-level directories is not supported可能已有人在做 @theMyth333 于 1026 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 20/100
docsifyjs/docsify-cli#179 · 1 条评论 ·
查看 docsifyjs/docsify-cli 的全部 Issue
相似的 Issue
-
fix(套件): test_bundle 往仓库的 preset/skills 写哨兵,并发跑的 test_installer 拷贝时撞 ENOENT(CI 红)可能已有人在做 @Miaotofu01 今天认领。 未关闭needs-triage
难度 2/5 1-3 小时 新手友好度 78/100
Miaotofu01/Study-Mate#216 · 1 条评论 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 78/100
-
beginner-friendly category:fixtures community enhancement first-timers-only good first issue hacktoberfest help wanted low hanging fruit micro-contribution type: task up-for-grabs
难度 1/5 1 小时以内 新手友好度 85/100
Berserk-hub150/skillhawk#229 · 1 条评论 ·
维护者通常 8 天内回复
-
WlanConfUpdateSensor falsely reports wifi interface appearing when sysfs inode cache is reclaimed未关闭
难度 2/5 1-3 小时 新手友好度 82/100
firewalla/firerouter#2180 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 84/100
andromarces/agent-loops#976 ·
维护者通常 1 天内回复