question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

node_modules/sharp makes problems

See original GitHub issue

Thanks for the great starter!

Two weeks ago it was working fine. But today I newly installed your starter, I was unable to run it on local server. Perhaps it’s not your starter’s fault, maybe it’s the sharp module.

The command I executed:

gatsby new gatsby-starter-sas-marketing https ://github.com/keegn/gatsby-starter-saas- marketing

cd gatsby-starter-saas-marketing

gatsby develop

Description of the error output:

Something went wrong installing the "sharp" module

Cannot find module '../build/Release/sharp.node'
Require stack:
- /Users/kyo/dev/Gastby/gatsby-starter-saas-marketing/node_modules/sharp/lib/constructor.js
- /Users/kyo/dev/Gastby/gatsby-starter-saas-marketing/node_modules/sharp/lib/index.js
- /Users/kyo/dev/Gastby/gatsby-starter-saas-marketing/node_modules/gatsby-plugin-sharp/safe-sharp.js
- /Users/kyo/dev/Gastby/gatsby-starter-saas-marketing/node_modules/gatsby-plugin-sharp/index.js
- /Users/kyo/dev/Gastby/gatsby-starter-saas-marketing/node_modules/gatsby-transformer-sharp/extend-node-type.js
- /Users/kyo/dev/Gastby/gatsby-starter-saas-marketing/node_modules/gatsby-transformer-sharp/gatsby-node.js
- /Users/kyo/dev/Gastby/gatsby-starter-saas-marketing/node_modules/gatsby/dist/bootstrap/resolve-module-exports.js
- /Users/kyo/dev/Gastby/gatsby-starter-saas-marketing/node_modules/gatsby/dist/bootstrap/load-plugins/validate.js
- /Users/kyo/dev/Gastby/gatsby-starter-saas-marketing/node_modules/gatsby/dist/bootstrap/load-plugins/load.js
- /Users/kyo/dev/Gastby/gatsby-starter-saas-marketing/node_modules/gatsby/dist/bootstrap/load-plugins/index.js
- /Users/kyo/dev/Gastby/gatsby-starter-saas-marketing/node_modules/gatsby/dist/bootstrap/index.js
- /Users/kyo/dev/Gastby/gatsby-starter-saas-marketing/node_modules/gatsby/dist/commands/develop.js
- /Users/kyo/.nodebrew/node/v14.2.0/lib/node_modules/gatsby-cli/lib/create-cli.js
- /Users/kyo/.nodebrew/node/v14.2.0/lib/node_modules/gatsby-cli/lib/index.js
- /Users/kyo/.nodebrew/node/v14.2.0/lib/node_modules/gatsby-cli/cli.js

- Remove the "node_modules/sharp" directory, run "npm install" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/en/stable/install/
- Search for this error at https://github.com/lovell/sharp/issues

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
newt0commented, Jul 11, 2020

https://github.com/gatsbyjs/gatsby/issues/4693#issuecomment-427256961

I’ve solved it!

Here are the steps:

  1. Delete node_modules folder
  2. Clear npm cache npm cache clean --force
  3. Re-install packages by running `npm install’
  4. Try again to run gatsby develop on your terminal/cmd.

#https://github.com/gatsbyjs/gatsby/issues/4693#issuecomment-427256961

1reaction
keegncommented, Jul 12, 2020

Thanks @newt0. I’ll try to reproduce this and will update accordingly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Something went wrong installing the "sharp" module #2517
the issue is probably caused by webpack-node-externals . it faild to add node modules to webpack.resolve.externals , because it resolves the ...
Read more >
Can't install Sharp - node.js - Stack Overflow
Simply put, npm tries to switch to a user account when installing modules, as modules installed as root can be only used by...
Read more >
sharp - npm
High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images. Latest version: 0.31.3, ...
Read more >
Troubleshooting Common Errors - Gatsby
The version of Node.js that's used to install sharp needs to match the version of Node.js that is run, so clearing node_modules and...
Read more >
How To Process Images in Node.js With Sharp - DigitalOcean
js has an ecosystem of libraries you can use to process images, such as sharp, jimp, and gm module. This article will focus...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found