How to setup Angular 2 project with local dev and remote deployment
<p>I have a large Angular 2 project which is connected to a git repository. Develop environment is my local machine with a remote server set up for deployment.</p>
<p>This works so far.</p>
<h2>Problem:</h2>
<p>Angular 2 and other node modules are managed on the remote server by invoking <code>npm install ...</code>. The npm updates don't get recognized by PhpStorm as they are just happening remotely, not local. This leads to situations where my local <code>node_modules</code> are out of sync with remote <code>node_modules</code>.</p>
<h2>Question:</h2>
<p>How can I avoid getting local and remote <code>node_modules</code> out of sync while maintaining a fast and productive dev environment?</p>
<hr />
<p>My current setup is:</p>
<ul>
<li>git repository on bitbucket.org</li>
<li>developing on my local machine (which has no webserver at all)</li>
<li>deploy to remote server (where I can execute the code)</li>
<li><code>/node_modules</code> is included in git repository</li>
</ul>
<p>What I tried so far:</p>
<ul>
<li>Development on remote server. Way to slow.</li>
<li>Tried to include <code>node_modules</code> as an external library in PhpStorm, as I can access the remote server via samba. PhpStorm can not resolve TypeScript includes like <code>import {Component} from '@angular/core';</code></li>
</ul>
<p>Any hints on how to set up a project like mine would be great.</p>