title: Why does Yeoman generator not work when installed through npm?
body: <h2>Code</h2>
  
  <ul>
  <li><strong>GitHub version</strong>: <a href="https://github.com/trevordmiller/generator-code-deck" rel="nofollow noreferrer">https://github.com/trevordmiller/generator-code-deck</a></li>
  <li><strong>npm version</strong>: <a href="https://www.npmjs.org/package/generator-code-deck" rel="nofollow noreferrer">https://www.npmjs.org/package/generator-code-deck</a></li>
  </ul>
  
  <h2>Background</h2>
  
  <p>I have built a Yeoman generator which is working perfectly locally (using <code>npm link</code> after cloning the repo from GitHub). However, when I <code>npm publish</code> the generator to npm and install it via <code>npm install -g generator-code-deck</code>, running the generator throws <code>no such file or directory</code> and <code>cannot find module</code> errors:</p>
  
  <p><img src="https://i.stack.imgur.com/DzE41.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/wG226.png" alt="enter image description here"></p>
  
  <p>These errors don't make sense to me, because 1. the files and folders are obviously there (as shown by the screenshot doodles) and 2. the generator is working via a symbolic link to the local repo; why should the npm package be any different?</p>
  
  <p>I have been searching online to find an answer but I can't find anything. <strong>Does anyone know why these errors are happening when trying to install via npm, but not via a symbolic link? Does anyone know how to fix this</strong> so that I can release the official npm version of the Yeoman generator? Any help would be much appreciated!</p>