modern.js
modern.js copied to clipboard
[Bug]: pnpm v7 和 git hook 的兼容性问题
版本信息
@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 项目
复现步骤
- npx @modern-js/create mobile-pages
- npm install -g pnpm@v7
- git add . && git commit "test"
pnpm v7 引入了一些不兼容更新,目前 modern.js 还未完成 pnpm v7 的适配,后续会安排上
这个问题可以通过升级项目中的 husky 到 v8 来解决,升级方式参见 https://github.com/typicode/husky-4-to-8