Only allow use pnpm #62
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is used to prompt when using yarn or npm or cnpm to install dependencies, only pnpm is supported
But there is a bug when using npm to install:
the execution of preinstall is after install
so when this prompt is displayed, the dependent packages have already been installed.
has another solution is:
"preinstall": "npx only-allow pnpm", it's use only-allow package be supported by pnpmThis solution has the same bug as above
这个 PR 用来在使用 yarn 或 npm 或 cnpm 安装依赖时,进行提示只支持 pnpm
但使用 npm 安装时有一个 bug:
preinstall 的执行是在 install 安装之后
所以当出现这个提示的时候,依赖包其实已经安装好了。(只能起到提示的作用)
还有一个方案是使用 pnpm 提供的包 (only-allow)[https://github.com/pnpm/only-allow]:
这个方案也会出现上面说到的 npm 的 bug