Skip to content

guides(Installation): instructions to install webpack-cli #1962

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/content/guides/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ npm install --save-dev webpack
npm install --save-dev webpack@<version>
```

Installing locally is what we recommend for most projects. This makes it easier to upgrade projects individually when breaking changes are introduced. Typically webpack is run via one or more [npm scripts](https://docs.npmjs.com/misc/scripts) which will look for a webpack installation in your local `node_modules` directory:
Installing locally is what we recommend for most projects. This makes it easier to upgrade projects individually when breaking changes are introduced. Typically webpack is run via one or more [npm scripts](https://docs.npmjs.com/misc/scripts) which requires the installation of `webpack-cli`:

```bash
npm install --save-dev webpack-cli
```

Now you can modify your `package.json` in order to find the package that was installed in your `node_modules/.bin` directory:

```json
"scripts": {
Expand All @@ -44,7 +50,7 @@ T> To run the local installation of webpack you can access its bin version as `n
The following NPM installation will make `webpack` available globally:

``` bash
npm install --global webpack
npm install --global webpack webpack-cli
```

W> Note that this is __not a recommended practice__. Installing globally locks you down to a specific version of webpack and could fail in projects that use a different version.
Expand Down