Skip to content
This repository has been archived by the owner on Jul 6, 2019. It is now read-only.

Commit

Permalink
Merge 0366a0d into cf6437c
Browse files Browse the repository at this point in the history
  • Loading branch information
zkat committed May 3, 2018
2 parents cf6437c + 0366a0d commit 5fe1f69
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ function ensurePackages (specs, opts) {
const bins = process.platform === 'win32'
? prefix
: path.join(prefix, 'bin')
const libs = process.platform === 'win32'
? path.join(prefix, 'node_modules')
: path.join(prefix, 'lib', 'node_modules')
const rimraf = require('rimraf')
process.on('exit', () => rimraf.sync(prefix))
return promisify(rimraf)(bins).then(() => {
Expand All @@ -156,6 +159,7 @@ function ensurePackages (specs, opts) {
// This is intentional, since npx assumes that if you went through
// the trouble of doing `-p`, you're rather have that one. Right? ;)
process.env.PATH = `${bins}${path.delimiter}${process.env.PATH}`
process.env.NODE_PATH = `${libs}${path.delimiter}${process.env.NODE_PATH || ''}`
if (!info) { info = {} }
info.prefix = prefix
info.bin = bins
Expand Down

0 comments on commit 5fe1f69

Please sign in to comment.