Docs: recommend use of npm cpu/os flags for cross-install

This commit is contained in:
Lovell Fuller 2023-11-05 14:08:31 +00:00
parent 4a37a27cca
commit 1915c1387e

View File

@ -117,6 +117,16 @@ depending on the chosen architecture.
When building your deployment package on a machine that differs from the target architecture, When building your deployment package on a machine that differs from the target architecture,
you will need to install either `@img/sharp-linux-x64` or `@img/sharp-linux-arm64` package. you will need to install either `@img/sharp-linux-x64` or `@img/sharp-linux-arm64` package.
```sh
npm install --os=linux --cpu=x64
```
```sh
npm install --os=linux --cpu=arm64
```
When using npm 9 or earlier, this can be achieved using the following:
```sh ```sh
npm install --force @img/sharp-linux-x64 npm install --force @img/sharp-linux-x64
``` ```
@ -174,7 +184,7 @@ custom:
- sharp - sharp
packagerOptions: packagerOptions:
scripts: scripts:
- npm install --force @img/sharp-linux-x64 - npm install --os=linux --cpu=x64 sharp
``` ```
## TypeScript ## TypeScript