Skip to content

Commit bf73119

Browse files
LitoMoreSBoudrias
authored andcommitted
Fix install command for npm global (#165)
1 parent 592b025 commit bf73119

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,12 @@ class UpdateNotifier {
135135

136136
if (options.isYarnGlobal) {
137137
installCommand = `yarn global add ${this.packageName}`;
138+
} else if (options.isGlobal) {
139+
installCommand = `npm i -g ${this.packageName}`;
138140
} else if (hasYarn()()) {
139141
installCommand = `yarn add ${this.packageName}`;
140142
} else {
141-
installCommand = `npm i ${options.isGlobal ? '-g ' : ''}${this.packageName}`;
143+
installCommand = `npm i ${this.packageName}`;
142144
}
143145

144146
options.message = options.message || 'Update available ' + chalk().dim(this.update.current) + chalk().reset(' → ') +

0 commit comments

Comments
 (0)