title: npm install not working with --prefix
body: <p>It seems that <code>npm install --prefix ./server</code> (with no args) is not working with <code>--prefix</code> flag. I just want to install all packages from package.json.
  All I get after that command is:</p>
  
  <blockquote>
    <p>npm WARN enoent ENOENT: no such file or directory, open
    '/home/.../ProjectName/server/package.json'</p>
  </blockquote>
  
  <p>All is fine when I put <code>npm install package_name -S --prefix ./server</code> for example. Then NPM will create <code>node_modules</code> in <code>server</code> and will add <code>package_name</code> package.</p>
  
  <p>My files structure is:</p>
  
  <pre><code>ProjectName
  |
  +-- client
  |   +-- node_modules
  |   +-- package.json
  +-- server
  |   +-- node_modules
  +-- package.json
  </code></pre>
  
  <p>"Main" <code>package.json</code> contains all scripts (for Heroku and for me) and dependiencies for server. 
  <code>client</code> is Angular2 app that's why it has own node_modules and package.json.</p>
  
  <p>I use NPM 4.2.0. With version 5.0.3 (newest?) it seems that <code>--prefix</code> flag is not working at all.</p>
  
  <p>EDIT #1</p>
  
  <p>I've just discovered that I can solve my problem with <code>npm install</code> (which will install <code>node_modules</code> in my project folder) and then copy <code>node_modules</code> to <code>server/node_modules</code>. Without that copy <code>jasmine</code> throws errors during <code>tsc</code> build.</p>
  
  <p>Now I have to have <code>node_modules</code> in main catalog and copy of them in <code>server</code>. That's so odd..</p>
  
  <p>EDIT #2</p>
  
  <p>According to <code>@Damian Lattenero</code> answer:</p>
  
  <blockquote>
    <p>npm --prefix ./server install ./ProjectName/package.json</p>
  </blockquote>
  
  <p>or</p>
  
  <blockquote>
    <p>npm --prefix ProjectName/server install ./ProjectName/package.json</p>
  </blockquote>
  
  <p>IS NOT WORKING and generates:</p>
  
  <blockquote>
    <p>npm ERR! code ENOLOCAL npm ERR! Could not install
    "RecursiveNotebook3/package.json" as it is not a directory and is not
    a file with a name ending in .tgz, .tar.gz or .tar</p>
  </blockquote>
  
  <p>THIS WORKS:</p>
  
  <blockquote>
    <p>npm --prefix ProjectName/server install ./ProjectName</p>
  </blockquote>
  
  <p>but generates:</p>
  
  <blockquote>
    <p>npm WARN saveError ENOENT: no such file or directory, open
    '/home/tb/Projects/RecursiveNotebook3/server/package.json' npm notice
    created a lockfile as package-lock.json. You should commit this file.
    npm WARN enoent ENOENT: no such file or directory, open '/home/
    tb/Projects/RecursiveNotebook3/server/package.json'</p>
  </blockquote>
  
  <p>and</p>
  
  <p><code>package-lock.json</code> next to <code>node_modules</code></p>
  
  <p>and </p>
  
  <p>empty <code>etc</code> catalog next to <code>node_modules</code></p>
  
  <p>and </p>
  
  <p>There are some problems with build (<code>tsc -p server</code>) with mongodb package.</p>