diff --git a/lib/resolver.js b/lib/resolver.js
index <HASH>..<HASH> 100644
--- a/lib/resolver.js
+++ b/lib/resolver.js
@@ -127,7 +127,9 @@ resolver.getNpmPaths = function () {
   paths.push(path.join(__dirname, '../..'));
 
   // adds support for generator resolving when yeoman-generator has been linked
-  paths.push(path.join(path.dirname(process.argv[1]), '../..'));
+  if (process.argv[1]) {
+    paths.push(path.join(path.dirname(process.argv[1]), '../..'));
+  }
 
   // Default paths for each system
   if (win32) {
Fixed bug where getNpmPaths fails when process.argv[1] is not provided (#<I>)