Install Webpack with NPM

Advertisement

To install the webpack, we need the NPM and Node.js pre-installed. If you don’t have them then see Installing NPM and Node.js

If you don’t have any sample project then create a sample project for webpack.

Now, We are ready to install the webpack.

npm install webpack --save-dev

Or, Use below shorthand command:

npm i webpack --save-dev

E.g.

c:\xampp\htdocs\tutorials\webpack-tutorial  (webpack-tutorial@1.0.0)
? npm i webpack --save-dev
...
+ webpack@4.44.1
added 572 packages from 358 contributors and audited 575 packages in 176.855s

21 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

We have now installed webpack.

We can see the webpack into the devDependencies from the package.json file as below:

{
  ..
  "devDependencies": {
    "webpack": "^4.44.1",
  }
}

Leave a Reply