7

I've installed Webpack through NPM in my ASP.NET core Web project. And now version of webpack is: 2.4.1. However, I need to install the following version of webpack: 2.1.0-beta.25.

I've tried to use the following command:

npm install webpack@2.1.0-beta.25

But it seems that this command is not installed a desired version of Webpack cause this command npm view webpack version shows: 2.4.1

How can I downgrade to 2.1.0-beta.25?

Penny Liu
  • 15,447
  • 5
  • 79
  • 98
StepUp
  • 36,391
  • 15
  • 88
  • 148
  • 1
    I didnt found webpack@2.1.0-beta.25 but there is webpack@2.1.0-beta.28 maybe try this one... to check all versions of webpack run "npm view webpack versions" ;) – MarcelD Apr 24 '17 at 13:56
  • 1
    `npm view webpack version` probably shows the latest available version, not the version you have installed. – Gimby Apr 24 '17 at 14:02
  • You should probably make sure your global and repository versions match, also – Sandy Gifford Apr 24 '17 at 16:35

3 Answers3

13

Try

npm uninstall webpack

npm install webpack@2.1.0-beta.25

or

npm uninstall webpack --save

npm install webpack@2.1.0-beta.25 --save
Gaurav Paliwal
  • 1,556
  • 16
  • 27
5

npm view does not show the installed packages, but information from the package repository. If you omit the version, it will always show the latest version.

You can use npm ls instead:

npm ls webpack
str
  • 42,689
  • 17
  • 109
  • 127
  • 1
    I've tries this command and see many errors: `+--ERR! peer dep missing UNMET PEER DEPENDENCY`, but can't see the version of webpack. Do you know what the problem is? – StepUp Apr 24 '17 at 14:18
  • 1
    @StepUp You have to be more specific. What peer dependencies are missing? – str Apr 24 '17 at 14:27
  • 1
    The following dependencies: `+-- UNMET PEER DEPENDENCY @angular/common@2.2.1 +-- UNMET PEER DEPENDENCY @angular/core@2.2.1 +-- UNMET PEER DEPENDENCY @angular/platform-browser@2.2.1 ` but I cannot know through `npm ls webpack` the installed version till I resolve dependencies? – StepUp Apr 24 '17 at 14:48
3

Just change the version in your **package.json** and hit npm i and it should have installed the mentioned version in package.json. for confirmation go to webpack folder in node_modules and read package.json and you should be able to see the same version. Or just do npm show webpack version and it will show you the installed version

Jorawar Singh
  • 7,463
  • 4
  • 26
  • 39