title: How to make a forked dependency in package.json run its prepare script during npm install?
body: <p>I forked <a href="https://github.com/mifi/ical-expander" rel="nofollow noreferrer">a NPM module</a> and modified it in <a href="https://github.com/haukepribnow/ical-expander" rel="nofollow noreferrer">my fork</a>. In my fork, the command <code>gulp</code> needs to be run to compile the module. Running this command will output the file <code>ical-expander-dist.js</code> into the <code>dist</code> folder. This file should become part of the fork package.</p>
  
  <p>The adjusted <code>package.json</code> in my fork looks like this:
  </p>
  
  <pre><code>{
    "name": "ical-expander",
    "version": "1.1.1",
    "description": "ICS / iCal / iCalendar parser / expander",
    "main": "dist/ical-expander-dist.js", // adjusted path
    "scripts": {
      "prepare": "gulp" // added script
    },
    // [SNIP] - excluded irrelevant lines
    "files": [
      "dist/ical-expander-dist.js" // adjusted path
    ]
  }
  </code></pre>
  
  <hr>
  
  <p>Now I want to make my fork a dependency of another project.</p>
  
  <pre><code>{
    "name": "otherproject",
    "title": "Other Project",
    // [SNIP] - excluded irrelevant lines
    "dependencies": {
      "ical-expander": "github:haukepribnow/ical-expander"
    }
    // [SNIP] - excluded irrelevant lines
  }
  </code></pre>
  
  <p>After executing <code>npm install</code> in <code>otherproject</code>'s root folder, the path <code>./node_modules/ical-expander</code> will contain the files <code>LICENSE</code>, <code>README.md</code> and <code>package.json</code>. It will however not contain <code>dist/ical-expander-dist.js</code>.</p>
  
  <p>It looks like the <code>prepare</code> script of my ical-expander fork is not being run during <code>npm install</code> in <code>otherproject</code>.</p>
  
  <hr>
  
  <p>So my question boils down to: How can I make sure that preparation scripts for compiling my fork are being run when executing <code>npm install</code> in a project that has my fork as one of its dependencies?</p>