Skip to content

Commit

Permalink
feat: support recovery from any npm link error
Browse files Browse the repository at this point in the history
  • Loading branch information
medikoo committed Oct 24, 2018
1 parent 9094fd5 commit dd453d0
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions lib/install-package.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,13 @@ const linkPackage = async (packagePath, packageName) => {
} catch (error) {
log.error("npm link of %s crashed:\n%#s", packageName, error.stderr);
if (
error.code === 1 &&
error.stderr.includes("npm ERR! Maximum call stack size exceeded")
(await realpath(resolve(await getNpmModulesPath(), packageName), { loose: true })) ===
packagePath
) {
if (
(await realpath(resolve(await getNpmModulesPath(), packageName), {
loose: true
})) === packagePath
) {
log.warning("npm crashed, but as link was created we're ignoring that fact");
return;
}
log.warning("npm crashed but as link was created we're ignoring that fact");
return;
}

throw error;
}
};
Expand Down

0 comments on commit dd453d0

Please sign in to comment.