npm install to specified directory
<p>According to <a href="https://stackoverflow.com/questions/14469515/how-to-npm-install-to-a-specified-directory">this post</a> and <a href="https://stackoverflow.com/questions/14742553/npm-local-install-package-to-custom-location">this post</a>, I can install packages by using command </p>

<pre><code>npm install --prefix &lt;path/to/prefix_folder&gt; -g
</code></pre>

<p><code>--prefix</code> is for specifying the location and <code>-g</code> is tell the npm to globally install. </p>

<p>However, neither using <code>-g</code> nor doesn't, it entirely copies my project to the prefix folder and create an <code>npm_modules</code> in the root of the cloned project while I execute the command!! Without <code>--prefix</code> the command can install packages correctly. </p>

<p>the package.json as bellow:</p>

<pre><code>{
  "name": "Javims-cms",
  "version": "1.0.0",
  "scripts": {
    "start": "concurrently \"npm run tsc:w\" \"npm run lite\" ",    
    "tsc": "tsc -p D:/localhost.server.com/projects/javims/mysite/cms",
    "tsc:w": "tsc -w -p D:/localhost.server.com/projects/javims/mysite/cms",
    "lite": "lite-server",
    "typings": "typings",
    "postinstall": "typings install" 
  },
  "license": "ISC",
  "dependencies": {
    "angular2": "2.0.0-beta.7",
    "systemjs": "0.19.22",
    "es6-promise": "^3.0.2",
    "es6-shim": "^0.33.3",
    "reflect-metadata": "0.1.2",
    "rxjs": "5.0.0-beta.2",
    "zone.js": "0.5.15",
  },
  "devDependencies": {
    "concurrently": "^2.0.0",
    "lite-server": "^2.1.0",
    "typescript": "^1.8.2",
    "typings":"^0.6.8"
  }
}
</code></pre>

<p><strong>Updates:</strong></p>

<pre><code>//the file structure of my project:  
myproject(project root)
    -access
    -package.json
    -typings.json
    -tsconfig.json

//the file structure after I run npm install --prefix ./access [-g] from project root
myproject(project root)
      -access
         -npm_modules
              -myproject(project root)
              -access
                 -npm_modules
                     - [packages]
              -package.json
              -typings.json
              -tsconfig.json
      -package.json
      -typings.json
      -tsconfig.json

//what I am expecting
myproject(project root)
   -access
      -npm_modules
          -(packages)
   -package.json
   -typings.json
   -tsconfig.json
</code></pre>