title: Use components from local npm repository in an Angular 2 application
body: <p>I have implemented a generic chart component with d3 and Angular 2. Then published it in a local <strong>npm</strong> repository so that anyone can use that chart component in their Angular project simply by running <strong>npm install my-chart</strong> command. </p>
  
  <p>I created a basic Angular 2 project to reuse my chart component. Then run <strong>npm install my-chart --save</strong>, it added <strong>"@my/my-chart": "^1.0.0"</strong> to the package.json. But there is a problem running <strong>ng serve</strong>, it prompt following error on my console.</p>
  
  <pre><code>Module not found: Error: Can't resolve 'd3' in '...\node_modules\@my\my-chart'
  </code></pre>
  
  <p>Do I need to install D3 in my Angular project? But I think it's better to bundle d3 with the chart component when we run <strong>npm install my-chart</strong>.</p>
  
  <p>What would be the best to to?</p>
  
  <p>package.json file for the published package:</p>
  
  <pre><code>{
    "name": "@my/my-chart",
    "version": "1.0.2",
    "license": "MIT",
    "angular-cli": {},
    "author": "rosew",
    "main": "./index.js",
    "keywords": [
      "button",
      "card"
    ]
  }
  </code></pre>
  
  <p>package.json file for the consuming package:</p>
  
  <pre><code>"dependencies": {
      "@angular/common": "2.4.6",
      "@angular/compiler": "2.4.6",
      "@angular/core": "2.4.6",
      "@angular/forms": "2.4.6",
      "@angular/http": "2.4.6",
      "@angular/platform-browser": "2.4.6",
      "@angular/platform-browser-dynamic": "2.4.6",
      "@angular/router": "3.4.6",
      "core-js": "2.4.1",
      "rxjs": "5.0.1",
      "ts-helpers": "1.1.2",
      "zone.js": "0.7.6",
  
      "@my/core": "1.1.176",
      "@my/my-button": "^1.0.9",
      "@my/my-chart": "^1.0.1"
    },
    "devDependencies": {
      "@angular/cli": "1.0.0-beta.31",
      "@angular/compiler-cli": "2.4.6",
      "@types/jasmine": "2.5.38",
      "@types/node": "6.0.42",
      "codelyzer": "2.0.0-beta.1",
      "jasmine-core": "2.5.2",
      "jasmine-spec-reporter": "2.5.0",
      "karma": "1.2.0",
      "karma-chrome-launcher": "2.0.0",
      "karma-cli": "1.0.1",
      "karma-jasmine": "1.0.2",
      "karma-remap-istanbul": "0.2.1",
      "protractor": "4.0.13",
      "ts-node": "1.2.1",
      "tslint": "4.4.2",
      "typescript": "2.0.3"
    }
  </code></pre>