chore(docs): remove suggestion of manually installing sharp
(#66034)
Users no longer need to install `sharp` manually thanks to the following: - https://github.com/vercel/next.js/pull/63321
This commit is contained in:
parent
bd2520a7d3
commit
9d70996ee9
3 changed files with 5 additions and 21 deletions
|
@ -80,7 +80,7 @@ Image Optimization can be used with a [static export](/docs/app/building-your-ap
|
|||
|
||||
> **Good to know:**
|
||||
>
|
||||
> - When self-hosting, consider installing `sharp` for more performant [Image Optimization](/docs/pages/building-your-application/optimizing/images) in your production environment by running `npm install sharp` in your project directory. On Linux platforms, `sharp` may require [additional configuration](https://sharp.pixelplumbing.com/install#linux-memory-allocator) to prevent excessive memory usage.
|
||||
> - On glibc-based Linux systems, Image Optimization may require [additional configuration](https://sharp.pixelplumbing.com/install#linux-memory-allocator) to prevent excessive memory usage.
|
||||
> - Learn more about the [caching behavior of optimized images](/docs/app/api-reference/components/image#caching-behavior) and how to configure the TTL.
|
||||
> - You can also [disable Image Optimization](/docs/app/api-reference/components/image#unoptimized) and still retain other benefits of using `next/image` if you prefer. For example, if you are optimizing images yourself separately.
|
||||
|
||||
|
|
|
@ -40,7 +40,6 @@ Additionally, a minimal `server.js` file is also output which can be used instea
|
|||
> **Good to know**:
|
||||
>
|
||||
> - If your project needs to listen to a specific port or hostname, you can define `PORT` or `HOSTNAME` environment variables before running `server.js`. For example, run `PORT=8080 HOSTNAME=0.0.0.0 node server.js` to start the server on `http://0.0.0.0:8080`.
|
||||
> - If your project uses [Image Optimization](/docs/app/building-your-application/optimizing/images) with the default `loader`, you must install `sharp` as a dependency:
|
||||
|
||||
</AppOnly>
|
||||
|
||||
|
@ -50,26 +49,9 @@ Additionally, a minimal `server.js` file is also output which can be used instea
|
|||
>
|
||||
> - `next.config.js` is read during `next build` and serialized into the `server.js` output file. If the legacy [`serverRuntimeConfig` or `publicRuntimeConfig` options](/docs/pages/api-reference/next-config-js/runtime-configuration) are being used, the values will be specific to values at build time.
|
||||
> - If your project needs to listen to a specific port or hostname, you can define `PORT` or `HOSTNAME` environment variables before running `server.js`. For example, run `PORT=8080 HOSTNAME=0.0.0.0 node server.js` to start the server on `http://0.0.0.0:8080`.
|
||||
> - If your project uses [Image Optimization](/docs/pages/building-your-application/optimizing/images) with the default `loader`, you must install `sharp` as a dependency:
|
||||
|
||||
</PagesOnly>
|
||||
|
||||
```bash filename="Terminal"
|
||||
npm i sharp
|
||||
```
|
||||
|
||||
```bash filename="Terminal"
|
||||
yarn add sharp
|
||||
```
|
||||
|
||||
```bash filename="Terminal"
|
||||
pnpm add sharp
|
||||
```
|
||||
|
||||
```bash filename="Terminal"
|
||||
bun add sharp
|
||||
```
|
||||
|
||||
## Caveats
|
||||
|
||||
- While tracing in monorepo setups, the project directory is used for tracing by default. For `next build packages/web-app`, `packages/web-app` would be the tracing root and any files outside of that folder will not be included. To include files outside of this folder you can set `experimental.outputFileTracingRoot` in your `next.config.js`.
|
||||
|
|
|
@ -28,10 +28,12 @@ pnpm add sharp
|
|||
bun add sharp
|
||||
```
|
||||
|
||||
Option 2: If using macOS, ensure XCode Build Tools are installed and try to install `sharp` again.
|
||||
Option 2: Try installing the wasm variant of `sharp` by running `npm install --cpu=wasm32 sharp`.
|
||||
|
||||
Option 3: If using macOS, ensure XCode Build Tools are installed and try to install `sharp` again.
|
||||
|
||||
For example, see [macOS Catalina instructions](https://github.com/nodejs/node-gyp/blob/66c0f0446749caa591ad841cd029b6d5b5c8da42/macOS_Catalina.md).
|
||||
|
||||
Option 3: Use a different OS and try to install `sharp` again.
|
||||
Option 4: Use a different OS and try to install `sharp` again.
|
||||
|
||||
For example, if you're using Windows, try using [WSL](https://docs.microsoft.com/en-us/windows/wsl/about) (Windows Subsystem for Linux).
|
||||
|
|
Loading…
Reference in a new issue