diff --git a/.gitignore b/.gitignore index 8eed729..b2fb330 100644 --- a/.gitignore +++ b/.gitignore @@ -9,8 +9,9 @@ lerna-debug.log* # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json -# VSCode +# Editor Files .vscode +.idea # Runtime data pids @@ -113,4 +114,4 @@ dist # Yarn files .yarn/install-state.gz -.yarn/build-state.yml \ No newline at end of file +.yarn/build-state.yml diff --git a/src/commands/init.js b/src/commands/init.js index 2d2d486..aeb4b9b 100644 --- a/src/commands/init.js +++ b/src/commands/init.js @@ -47,7 +47,7 @@ export async function init({ flags }) { } else { data = await prompt([name, lang, main_dir, cmds_dir, default_prefix]); git_init = (await prompt([gitInit])).gitinit; - await npm(); + pm = await npm(); } if (Object.keys(data).length < 5) process.exit(1); diff --git a/src/utilities/npm.js b/src/utilities/npm.js index 1e6706e..c4e5596 100644 --- a/src/utilities/npm.js +++ b/src/utilities/npm.js @@ -5,10 +5,10 @@ import { execa } from 'execa'; * @returns A promise that resolves to a string. */ export async function npm() { - const npm = await execa('npm', ['-v']); + const npm = await execa('npm', ['-v']).catch(() => null); const npm_version = npm?.stdout; - const yarn = await execa('yarn', ['-v']); + const yarn = await execa('yarn', ['-v']).catch(() => null); const yarn_version = yarn?.stdout; if (npm_version && !yarn_version) {