Skip to content

Commit 40e911d

Browse files
committed
docs: postinstall configuration examples
1 parent 5c25613 commit 40e911d

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

docs/guide/troubleshooting.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,8 @@ If you want to customize the `postinstall` behavior, you can do so using any of
178178
* Passing the `--node-llama-cpp-postinstall=<behavior>` flag to the `npm install` command.
179179
* Setting the `NODE_LLAMA_CPP_POSTINSTALL` environment variable to `<behavior>` before running `npm install`.
180180
* Configuring `config.nodeLlamaCppPostinstall` on your project's `package.json` to `<behavior>`.
181+
<br/>
182+
This will only work when your module is installed globally using `npm -g` or for a non-library project when you run `npm install` in the project root; it will not work when your module is installed as a dependency of another module.
181183

182184
Where `<behavior>` can be one of the following options:
183185
* **`auto` (default)**: the default behavior explained above.
@@ -187,3 +189,25 @@ Where `<behavior>` can be one of the following options:
187189
* **`skip`**: skip the entire `postinstall` script.
188190
If the prebuilt binaries are incompatible with the current machine,
189191
using [`getLlama`](../api/functions/getLlama.md) for the first time will attempt building from source by default.
192+
193+
::: code-group
194+
```shell [<code>npm install</code> flag]
195+
npm install --node-llama-cpp-postinstall=ignoreFailedBuild
196+
```
197+
198+
```shell [env var (bash)]
199+
NODE_LLAMA_CPP_POSTINSTALL=ignoreFailedBuild npm install
200+
```
201+
202+
```shell [env var (using <code>cross-env</code>)]
203+
npx --yes cross-env NODE_LLAMA_CPP_POSTINSTALL=ignoreFailedBuild npm install
204+
```
205+
206+
```json [<code>package.json</code>]
207+
{
208+
"config": {
209+
"nodeLlamaCppPostinstall": "ignoreFailedBuild"
210+
}
211+
}
212+
```
213+
:::

0 commit comments

Comments
 (0)