Skip to content

Commit

Permalink
fix: registryUrl
Browse files Browse the repository at this point in the history
  • Loading branch information
atian25 committed Nov 18, 2016
1 parent 5d5c837 commit 6715b3d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/init_command.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,7 @@ module.exports = class Command {
if (fs.existsSync(path.join(home, '.cnpmrc')) || fs.existsSync(path.join(home, '.tnpmrc'))) {
url = 'https://registry.npm.taobao.org';
}
url = url.replace(/\/$/, '');
return url;
}
}
Expand Down Expand Up @@ -457,6 +458,7 @@ module.exports = class Command {
return result.data;
} catch (err) {
if (withFallback) {
this.log('use fallback from ${pkgName}');
return require(`${pkgName}/package.json`);
} else {
throw err;
Expand Down

0 comments on commit 6715b3d

Please sign in to comment.