Hi Dharshika Sivakumar,
This is a common scenario in enterprise environments where servers are isolated for security reasons.
So you need Angular CLI v19.0.6 with Node.js v20.9.0 on an IIS server that has no internet connectivity. The challenge is that Angular CLI and its dependencies are distributed via npm, which normally requires internet access. However, this is possible using an offline installation strategy. I can be tricky because:
- Angular CLI depends on multiple npm packages.
- npm by default fetches packages from the registry.
- Without internet, you must pre-download all dependencies and transfer them to the offline server.
Solution 1: Official Offline Installation Approach
Step 1: Prepare on an Online Machine
- Install Node.js 20.9.0 (LTS) on your online machine: Node.js v20.9.0
- Install Angular CLI v19.0.6 globally:
npm install -g @angular/cli@19.0.6
- Download all required packages for offline use:
- Use
npm pack
to create tarballs for Angular CLI and its dependencies:
mkdir offline-packages
cd offline-packages
npm pack @angular/cli@19.0.6
- Or hydrate npm cache for offline mode:
npm install --cache ./npm-cache --prefer-offline
Step 2: Transfer to the Offline IIS Server
- Copy:
- Node.js installer
- The
offline-packages
folder or npm cache
- Install Node.js on the IIS server.
- Configure npm to use the local cache:
npm config set cache "C:\path\to\npm-cache"
- Install Angular CLI offline:
npm install -g @angular/cli@19.0.6 --offline
Solution 2: Manual Zip & Transfer method
If you prefer a simpler approach without npm cache tricks, you can follow this method:
On an online machine:
- Create a folder and run:
- npm install @angular/cli@19.0.6
- This will download Angular CLI and all dependencies into
node_modules
.
npm install @angular/cli@19.0.6
- Create a folder and run:
- npm install @angular/cli@19.0.6
- This will download Angular CLI and all dependencies into
node_modules
.
Zip the entire folder (including node_modules
) and transfer it to the offline server.
Extract it and use the CLI from the bin
folder (e.g., node_modules/.bin/ng
).
For creating projects offline:
ng new my-project --skip-install
Let me know how it goes! I'd be happy to help.