`sharp` module preventing the dev server from being started.

default discord avatar
zochh
2 months ago
14

The error:


C:\Users\<user>\Desktop\code\texturepacksmc\payload\node_modules\payload-webp\node_modules\sharp\lib\sharp.js:37
  throw new Error(help.join('\n'));
        ^
Error:
Something went wrong installing the "sharp" module

The specified procedure could not be found.
\\?\C:\Users\<user>\Desktop\code\texturepacksmc\payload\node_modules\payload-webp\node_modules\sharp\build\Release\sharp-win32-x64.node


Is fine if I run it on WSL but, node is slow on WSL. Any fix for this? I use cmd primarily

  • default discord avatar
    notchr
    2 months ago

    @zochh Sharp has caused a few issues for folks in the past



    What operating system are you installing Payload on?



    Looks like Windows

  • default discord avatar
    zochh
    2 months ago

    Windows 11; it just started doing that

  • default discord avatar
    notchr
    2 months ago

    Did you update node or changed versions?

  • default discord avatar
    zochh
    2 months ago

    Nope, updated node to v20 from v19 (cant remember subversions) last week, and it worked last week after updating too

  • default discord avatar
    notchr
    2 months ago

    So sharp is a module that generally compiles via node-gyp on installation. This issue, among others, is typically because of a change in node.js versions and the version support with Sharp



    You can try to clear your npm cache and rebuild your repository node modules



    I think it's



    npm cache clear


    npm rebuild --verbose sharp


    If that doesn't work, I have some other ideas

  • default discord avatar
    zochh
    2 months ago

    same for yarn?



    I use yarn instead of npm

  • default discord avatar
    notchr
    2 months ago

    Yeah I would try to clear the yarn cache and then attempt a rebuild, I'm not sure if the syntax is the same

  • default discord avatar
    zochh
    2 months ago

    cahce clean worked, rebuild didnt



    looking up for the yarn sytanx

  • default discord avatar
    notchr
    2 months ago

    hmmm



    yarn rebuild sharp



    i think should work

  • default discord avatar
    zochh
    2 months ago

    Command

    rebuild

    not found

  • default discord avatar
    zochh
    2 months ago

    whoops, having yarn 1.xx

  • default discord avatar
    notchr
    2 months ago

    @zochh Maybe a yarn update will resolve the module issue'

  • default discord avatar
    zochh
    2 months ago

    yarn upgrade broke the package.json haha. Reverted the changes- going to use npm for the payload bit



    Heya, sorry got caught up in work irl



    and updated yarn to v2, and try rebuilding



    and when running the dev server same error



    I've figured the issue out;


    Needed to add this to

    package.json
      "resolutions": {
        "sharp": "latest"
      }

    and needed to remove the webp plugin

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.