Skip to content

Commit

Permalink
Merge pull request #181 from YDX-2147483647/patch-1
Browse files Browse the repository at this point in the history
doc: Add instructions on setting `NPM_BIN_PATH` on Windows
  • Loading branch information
timonweb committed Dec 14, 2023
2 parents 7923248 + d756771 commit 37ffb7c
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,24 @@ this case, you need to set the path to the `npm` executable in *settings.py* fil
NPM_BIN_PATH = '/usr/local/bin/npm'
```

On *Windows* it might look like this:
On *Windows*, you may have npm on `$PATH` but it's `npm.cmd` rather than `npm`. (You can call it from the terminal because `$PATHEXT` contains `.cmd`.) If so, please override the default `NPM_BIN_PATH = 'npm'`:

```python
NPM_BIN_PATH = 'npm.cmd'
```

Alternatively (and for maximum reliability), you can use a fully qualified path. It might look like this:

```python
NPM_BIN_PATH = r"C:\Program Files\nodejs\npm.cmd"
```

Please note that the path to the `npm` executable may be different for your system. To get the `npm` path, try running
the command `which npm` in your terminal.
the command `which npm` in your terminal. (On *Windows*, please try `where npm` or `Get-Command npm`)

If you share codes with others, you can search `$PATH` (and `$PATHEXT` on Windows) dynamically in *settings.py*:

```python
from shutil import which
NPM_BIN_PATH = which("npm")
```

0 comments on commit 37ffb7c

Please sign in to comment.