title: Openshift deploy angular application
body: <p>I am trying to deploy an agular application in openshift.</p>
  
  <p>I am using nodesjs s2i image, with the git source. <a href="https://github.com/kaushik9845/angularopenshift.git" rel="nofollow noreferrer">https://github.com/kaushik9845/angularopenshift.git</a></p>
  
  <p>I have used custom assemble script as below lines were making the build fail with reason 
  ---> Cleaning up npm cache
  rm: cannot remove '.npm/_cacache/content-v2/sha512/0b/61': Directory not empty
  rm: cannot remove '.npm/_cacache/content-v2/sha512/10/7d': Directory not empty
  rm: cannot remove '.npm/_cacache/content-v2/sha512/19/2f': Directory not empty
  rm: cannot remove '.npm/_cacache/index-v5/07/1c': Directory not empty
  rm: cannot remove '.npm/_cacache/index-v5/37/5c': Directory not empty
  rm: cannot remove '.npm/_cacache/index-v5/99/a0': Directory not empty</p>
  
  <pre><code>echo "---&gt; Cleaning up npm cache"
  rm -rf .npm
  </code></pre>
  
  <p>So skipping that line in the custom assemble script.</p>
  
  <pre><code>#!/bin/bash
  
  echo "Custom assembling"
  
  
  echo "---&gt; Installing application source"
  cp -Rfp /tmp/src/. ./
  npm config set registry http://registry.npmjs.org/
  npm config set loglevel warn
  npm install
  ng build --prod --base-href /mybuild/
  fix-permissions /opt/app-root
  
  exit 0
  </code></pre>
  
  <p>But it is failing with the below error</p>
  
  <pre><code>Error: Cannot find module '/opt/app-root/src/server.js'
  at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
  at Function.Module._load (internal/modules/cjs/loader.js:506:25)
  at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
  at startup (internal/bootstrap/node.js:285:19)
  at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
  </code></pre>