vercel / next.js

The React Framework
https://nextjs.org
MIT License
127.14k stars 27.02k forks source link

Missing Err.sh document for Sharp installation #18347

Closed keegandonley closed 4 years ago

keegandonley commented 4 years ago

Bug report

Describe the bug

The err.sh link given by Next 10 goes to a 404: https://err.sh/next.js/install-sharp links to https://github.com/vercel/next.js/blob/master/errors/install-sharp.md

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Upgrade to Next 10
  2. Don't have Sharp installed
  3. Use the image component
  4. See error

Expected behavior

This link should link to the correct document

Screenshots

If applicable, add screenshots to help explain your problem.

System information

Additional context

Add any other context about the problem here.

ijjk commented 4 years ago

Hi, thanks for the report! The mentioned link should now be available

timneutkens commented 4 years ago

The doc should be updated as sharp is installed by default, seemingly the installation failed on your device though 🤔

keegandonley commented 4 years ago

Thanks @timneutkens! Yeah this was kind of a weird case for me. The XCode command line tools seemed corrupted or partially missing so building and installing sharp failed until I removed them and re-installed.

luknl commented 4 years ago

Had the same error on Mac:

{ Error: Cannot find module 'sharp'

Learn more: https://err.sh/next.js/install-sharp
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.Module._load (internal/modules/cjs/loader.js:506:25)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at imageOptimizer (...../app/node_modules/next/dist/next-server/server/image-optimizer.js:4:7)
    at process._tickCallback (internal/process/next_tick.js:68:7) code: 'MODULE_NOT_FOUND' }

Tried to uninstall and re-install XCode command line tools but that didn't work. Tried to fix it with the upcoming updated doc here, and option 1 worked! I was using node v10.13.0, so I did this to update to latest stable version (currently v14.15.0). Then after a npm i sharp, the error was gone   🎉.

pedromagalhaes commented 3 years ago

This happens because you are using a wrong Node version. Check your warnings when building the app.

In my case I got the following: sharp@0.26.2: The engine "node" is incompatible with this module. Expected version ">=10.16.0"

Use NVM to add a new version.

balazsorban44 commented 2 years ago

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.