sindresorhus / global-directory

Get the directory of globally installed packages and binaries
MIT License
75 stars 10 forks source link

Fails when process.env.APPDATA is undefined in win32 #2

Closed marionebl closed 7 years ago

marionebl commented 7 years ago

On windows global-dirs fails with the following error if APPDATA is not defined. This appears to to be the case for AppVeyor environments:

TypeError: Path must be a string. Received undefined
      at assertPath (path.js:7:11)
      at Object.join (path.js:482:7)
      at getNpmPrefix (~\node_modules\global-dirs\index.js:44:15)
      at Object.<anonymous> (~\node_modules\global-dirs\index.js:50:32)
      at Module._compile (module.js:570:32)
      at Object.Module._extensions..js (module.js:579:10)
      at Module.load (module.js:487:32)
      at tryModuleLoad (module.js:446:12)
      at Function.Module._load (module.js:438:3)
      at Module.require (module.js:497:17)
  ]

AppVeyor Example: https://ci.appveyor.com/project/marionebl/commitlint/build/358#L1674