Improve the error message on install dependencies error in create strapi-app

This commit is contained in:
Alexandre Bodin 2019-10-29 08:54:46 +01:00
parent 82b36df90c
commit d73e842d2f
3 changed files with 22 additions and 2 deletions

View File

@ -105,7 +105,26 @@ module.exports = async function createProject(
await captureStderr('didNotInstallProjectDependencies', error);
stopProcess('Stopping installation');
console.log(chalk.black.bgWhite(' Keep trying! '));
console.log();
console.log(
chalk.bold(
'Oh, it seems that you encountered errors while installing dependencies in your project.'
)
);
console.log(`Don't give up, your project was created correctly.`);
console.log(
`Fix the issues mentionned in the installation errors and try to run the following command:`
);
console.log();
console.log(
`cd ${chalk.green(rootPath)} && ${chalk.cyan(
scope.useYarn ? 'yarn' : 'npm'
)} install`
);
console.log();
stopProcess();
}
await trackUsage({ event: 'didCreateProject', scope });

View File

@ -1,6 +1,6 @@
'use strict';
module.exports = function stopProcess(message) {
console.error(message);
if (message) console.error(message);
process.exit(1);
};

View File

@ -14,6 +14,7 @@
},
"dependencies": {
"@sentry/node": "^5.7.1",
"chalk": "^2.4.2",
"execa": "^1.0.0",
"fs-extra": "^8.0.1",
"inquirer": "^6.3.1",