modern.js icon indicating copy to clipboard operation
modern.js copied to clipboard

[Bug]: pnpm v7 和 git hook 的兼容性问题

Open xalanq opened this issue 3 years ago • 2 comments

版本信息

@modern-js/[email protected] -> ./node_modules/.pnpm/registry.npmmirror.com+@[email protected]_femxfsv7ntf2nz4bpj36nj6mcm/node_modules/@modern-js/app-tools
└─┬ @modern-js/[email protected] -> ./node_modules/.pnpm/registry.npmmirror.com+@[email protected]_47l77qdyy2tfsqtk7ztcktvx5m/node_modules/@modern-js/plugin-electron
  └── @modern-js/[email protected] -> ./node_modules/.pnpm/registry.npmmirror.com+@[email protected]_femxfsv7ntf2nz4bpj36nj6mcm/node_modules/@modern-js/app-tools

问题详情

pnpm 升级到 v7 后,git commit 会报错,降级到 v6 后错误消失

 ERR_PNPM_FETCH_404  GET https://registry.npmjs.org/--no-install: Not Found - 404

--no-install is not in the npm registry, or you have no permission to fetch it.

No authorization header was set for the request.

复现链接

新建一个 electron 项目

复现步骤

  1. npx @modern-js/create mobile-pages
  2. npm install -g pnpm@v7
  3. git add . && git commit "test"

xalanq avatar May 13 '22 14:05 xalanq

pnpm v7 引入了一些不兼容更新,目前 modern.js 还未完成 pnpm v7 的适配,后续会安排上

chenjiahan avatar May 14 '22 02:05 chenjiahan

这个问题可以通过升级项目中的 husky 到 v8 来解决,升级方式参见 https://github.com/typicode/husky-4-to-8

chenjiahan avatar Jun 22 '22 02:06 chenjiahan