PGH
PGH

Reputation: 2204

Issue while installing flex layout

I am trying to install flex-layout using this command npm install --save @angular/flex-layout.

I am getting these errors:

enter image description here

node version: v10.1.0
npm version: 6.0.1
Angular : 6.1.2

I have created many branches for the project in Visual studio code(vscode),In the last branch this installation was successful and in the package.json file it was showing in dependencies as "@angular/flex-layout": "^6.0.0-beta.18",

Now in the new branch i am trying to install with the same command.Now in the package.json file, the dependencies is like this "@angular/flex-layout": "^7.0.0-beta.19", and getting the errors as shown in above image.

How can i install particular version of flex-layout means version 6??

Upvotes: 3

Views: 10397

Answers (3)

ibenjelloun
ibenjelloun

Reputation: 7733

To install a specific version you can add @<verions> to the package name, for example :

npm install --save @angular/[email protected]

You can have the list of avaible versions on npmjs.org: https://www.npmjs.com/package/@angular/flex-layout

Upvotes: 10

Pipo
Pipo

Reputation: 5093

npm install --legacy-peer-deps saved hours my life

Upvotes: 0

Vivek Kumar
Vivek Kumar

Reputation: 5050

It seems that @angular/flex-layout": "^7.0.0-beta.19" is for angular v7.

Try using any 6.0.0-beta.18

Release note says: (https://github.com/angular/flex-layout/releases)

feat: upgrade to TypeScript v3.1 (#860)

  • Upgrade apps to Angular CLI v7
  • Update versions in package.json to v7 for Angular and Material
  • Update to TypeScript v3.1 and change the MatchMedia interface to match updated spec

And it seems that your @angular/cli and typescript is not same as of latest flex-layout

Upvotes: 3

Related Questions