Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions lib/commands/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,9 @@ class Install extends ArboristWorkspaceCmd {

async exec (args) {
// the /path/to/node_modules/..
const globalTop = resolve(this.npm.globalDir, '..')
const ignoreScripts = this.npm.config.get('ignore-scripts')
const isGlobalInstall = this.npm.global
const where = isGlobalInstall ? globalTop : this.npm.prefix
const where = this.npm.prefix
const forced = this.npm.config.get('force')
const scriptShell = this.npm.config.get('script-shell') || undefined

Expand Down Expand Up @@ -128,13 +127,13 @@ class Install extends ArboristWorkspaceCmd {
args = args.filter(a => resolve(a) !== this.npm.prefix)

// `npm i -g` => "install this package globally"
if (where === globalTop && !args.length) {
if (isGlobalInstall && !args.length) {
args = ['.']
}

// throw usage error if trying to install empty package
// name to global space, e.g: `npm i -g ""`
if (where === globalTop && !args.every(Boolean)) {
if (isGlobalInstall && !args.every(Boolean)) {
throw this.usageError()
}

Expand Down