Angular Info, Samples and Stuff
How I work with angular-cli on a computer that does not have internet access. This is helpful for corportate, secure environments and during travel.
STEPS
You will need to perform these steps on a computer that has internet access. After that you will be able to transfer some folders to your offline computer.
Online Computer
- Install www.nodejs.com "LTS" version
- Install cli.angular.io
>npm install -g @angular/cli
>ng new onlineapp
// after npm install completes successfully
>cd onlineapp
>ng serve
// make sure app was installed and runs correctly
- Find your npm_cache folders (windows: %appdata%\Roaming\npm_cache)
- zip npm_cache folder and name it npm_cache.zip
Offline Computer
- Install www.nodejs.com "LTS" version
- extract npm_cache.zip contents into your npm_cache folder (windows: %appdata%\Roaming\npm_cache)
- configure npm to use your local npm_cache folder
>npm config set cache PATH_TO_CACHE_FOLDER
>npm config set cache min 999999999
>npm config shrinkwrap false
- Install Angular-CLI from cache
>npm install -g @angular/cli
- create a new Angular project with CLI and confirm it runs
>ng new offlineapp
// after npm install completes successfully
>cd offlineapp
>ng serve
// make sure app was installed and runs correctly
To add new/additional components to your offline environment:
- npm install them on your online environment
// for example adding bootstrap 4
>npm install bootstrap@next --save
- zip the npm_cache folder
- unzip the npm_cache.zip contents on your offline environment.