Arjun Lubana
Arjun Lubana

Reputation: 57

How do I create a new angular app with ng command using yarn offline flag?

I am trying to create a new angular app while offline by running the following command with yarn as my default package manager

ng new my-app

The app boilerplate is created but when installing packages using yarn. Yarn keeps throwing an error saying I am offline, which I am, but I want the yarn to use the offline cache for angular to create the new app. I have tried running:

ng new my-app --offline

But angular CLI does not recognize the offline flag. npm used to work fine while I was offline, how do I get this working with yarn?

Upvotes: 0

Views: 670

Answers (1)

deepakchethan
deepakchethan

Reputation: 5600

You can create the application with --skip-install to avoid install and use npm install --offline if you are using npm version greater than v5.0.0:

ng new test-app --skip-install
cd test-app
npm install --offline

It does error out if the package you want is not in the cache.

Upvotes: 1

Related Questions