Skip to content

Commit

Permalink
Show friendly error message when npm-link fails (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
LitoMore authored Jan 31, 2022
1 parent 1caa2f2 commit 82c4d46
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,12 +130,17 @@ module.exports = () => {
},
{
title: 'Link executable',
task: async () => {
task: async (_, task) => {
if (useTypeScript) {
await execa('npm', ['run', 'build']);
}

return execa('npm', ['link']);
try {
await execa('npm', ['link']);
// eslint-disable-next-line unicorn/prefer-optional-catch-binding
} catch (_) {
task.skip('npm link failed, please try running with sudo');
}
}
}
]);
Expand Down

0 comments on commit 82c4d46

Please sign in to comment.