-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: readme提示限定node版本 * feat: 限制node版本为18+ * feat: 限制pnpm版本为8+ * feat: check the version of pnpm before install dependencies * feat: 调整启动脚本 --------- Co-authored-by: CoderSerio <CoderSerio@[email protected]>
- Loading branch information
1 parent
197bb61
commit 28a8ad8
Showing
4 changed files
with
21 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
registry=https://registry.npmjs.org | ||
registry=https://registry.npmjs.org |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ | |
进入项目仓库<br> | ||
|
||
```sh | ||
# 请使用pnpm 8进行安装,避免依赖结构问题导致后续命令无法执行 | ||
pnpm i | ||
npm run build:all | ||
``` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const childProcess = require("child_process"); | ||
|
||
let version; | ||
try { | ||
version = childProcess.execSync("pnpm -v").toString(); | ||
} catch (err) { | ||
console.error(`Error: can't find module 'pnpm'.`); | ||
process.exit(1); | ||
} | ||
|
||
const majorVersion = version?.split(".")?.[0]; | ||
if (!majorVersion || +majorVersion < 8) { | ||
console.error( | ||
`Error: required pnpm version is not less than 8.0.0, but got ${version}.` | ||
); | ||
process.exit(1); | ||
} |