Skip to content

Commit

Permalink
chore(create): Update minimum versions of Node & Yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelbromley committed Mar 20, 2024
1 parent dfb69a5 commit 6588365
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 2 additions & 1 deletion packages/create/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ It will create a directory called `my-app` inside the current folder.

### `--use-npm`

By default, Vendure Create will attempt to use Yarn to install all dependencies if it is available. You can override this and force it to use npm with the `--use-npm` flag.
By default, Vendure Create will detect whether a compatible version of Yarn is installed, and if so will display a prompt to select the preferred package manager.
You can override this and force it to use npm with the `--use-npm` flag.

### `--log-level`

Expand Down
2 changes: 1 addition & 1 deletion packages/create/src/constants.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const REQUIRED_NODE_VERSION = '>=14.0.0';
export const REQUIRED_NODE_VERSION = '>=20.0.0';
export const SERVER_PORT = 3000;
/**
* The TypeScript version needs to pinned because minor versions often
Expand Down
8 changes: 6 additions & 2 deletions packages/create/src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,12 @@ export function checkNodeVersion(requiredVersion: string) {

export function yarnIsAvailable() {
try {
execSync('yarnpkg --version', { stdio: 'ignore' });
return true;
const yarnVersion = execSync('yarnpkg --version');
if (semver.major(yarnVersion.toString()) > 1) {
return true;
} else {
return false;
}
} catch (e: any) {
return false;
}
Expand Down

0 comments on commit 6588365

Please sign in to comment.