2
votes

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??

3

3 Answers

9
votes

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

3
votes

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

0
votes

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