Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module '../build/Release/sharp.node' #4693

Closed
timojaask opened this issue Mar 24, 2018 · 17 comments
Closed

Cannot find module '../build/Release/sharp.node' #4693

timojaask opened this issue Mar 24, 2018 · 17 comments

Comments

@timojaask
Copy link

timojaask commented Mar 24, 2018

Description

Running gatsby develop throws an error:

$ gatsby develop
success delete html and css files from previous builds — 0.050 s
success open and validate gatsby-config.js — 0.004 s
success copy gatsby files — 0.012 s
error UNHANDLED EXCEPTION


  Error: Cannot find module '../build/Release/sharp.node'
  
  - v8-compile-cache.js:159 require
    [almost-hipster]/[v8-compile-cache]/v8-compile-cache.js:159:20
  
  - constructor.js:10 Object.<anonymous>
    [almost-hipster]/[sharp]/lib/constructor.js:10:15
  
  - v8-compile-cache.js:178 Module._compile
    [almost-hipster]/[v8-compile-cache]/v8-compile-cache.js:178:30
  
  - v8-compile-cache.js:159 require
    [almost-hipster]/[v8-compile-cache]/v8-compile-cache.js:159:20
  
  - index.js:3 Object.<anonymous>
    [almost-hipster]/[sharp]/lib/index.js:3:15
  
  - v8-compile-cache.js:178 Module._compile
    [almost-hipster]/[v8-compile-cache]/v8-compile-cache.js:178:30
  
  - v8-compile-cache.js:159 require
    [almost-hipster]/[v8-compile-cache]/v8-compile-cache.js:159:20
  
  - index.js:562 Object.<anonymous>
    [almost-hipster]/[gatsby-plugin-sharp]/index.js:562:13
  
  - v8-compile-cache.js:178 Module._compile
    [almost-hipster]/[v8-compile-cache]/v8-compile-cache.js:178:30

This started happening after I tried to install gatsby-plugin-google-analytics and copy-pasted the necessary lines into the gatsby-config.js file:

yarn add gatsby-plugin-google-analytics

See below for gatsby-config.js.

Reverting to any previously working commit doesn't fix the error, so it seems like some sort of caching issue.

The only workaround that worked for me is to deleting the entire project and re-clone it from git. Then everything works again:

cd ..
rm -rf project-name
git clone git@github.com:your-name/project-name.git
cd project-name
yarn
gatsby develop

It seems like any "weird" issue with gatsby can be fixed by committing your changes to git, nuking it all, and re-downloading.

Steps to reproduce

$ gatsby develop

Expected result

Gatsby development server should be running.

Actual result

Gatsby throws an error described above and exits.

Environment

  • Gatsby version (npm list gatsby): 1.9.236
  • gatsby-cli version (gatsby --version): 1.1.48
  • Node.js version: 8.9.4
  • Operating System: macOS 10.13.3

File contents (if changed):

gatsby-config.js:

module.exports = {
  plugins: [
    {
      resolve: `gatsby-plugin-typography`,
      options: {
        pathToConfigModule: `src/utils/typography.js`,
      },
    },
    `gatsby-transformer-sharp`,
    `gatsby-plugin-sharp`,
    {
      resolve: `gatsby-source-filesystem`,
      options: {
        path: `${__dirname}/src/images`,
        name: 'images',
      },
    },
    {
      resolve: `gatsby-plugin-google-analytics`,
      options: {
        trackingId: "YOUR_GOOGLE_ANALYTICS_TRACKING_ID,
        // Puts tracking script in the head instead of the body
        head: false,
        // Setting this parameter is optional
        anonymize: true,
        // Setting this parameter is also optional
        respectDNT: true,
      },
    },
  ],
};

package.json:

{
  "name": "gatsby-starter-hello-world",
  "description": "Gatsby hello world starter",
  "license": "MIT",
  "scripts": {
    "develop": "gatsby develop",
    "build": "gatsby build",
    "serve": "gatsby serve"
  },
  "dependencies": {
    "gatsby": "^1.9.236",
    "gatsby-image": "^1.0.42",
    "gatsby-link": "^1.6.39",
    "gatsby-plugin-google-analytics": "^1.0.24",
    "gatsby-plugin-sharp": "^1.6.41",
    "gatsby-plugin-typography": "^1.7.18",
    "gatsby-source-filesystem": "^1.5.27",
    "gatsby-transformer-sharp": "^1.6.22",
    "lodash": "^4.17.5",
    "typography-theme-fairy-gates": "^0.15.11"
  }
}

@huy-nguyen
Copy link

Had the same error. Deleting node_modules, .cache, public and reinstalling all dependencies fixed it for me.

@SiriusBits
Copy link

Had a similar issue and deleting as @huy-nguyen mentions did the trick.

@seang
Copy link

seang commented Apr 18, 2018

perfect thanks!

@m-allanson
Copy link
Contributor

Thanks folks!

Closing as this seems like an npm install issue.

@okabrionz
Copy link

here steps to resolve this issue:

  1. Delete node_modules folder
  2. Clear npm cache npm cache clean --force
  3. (Optional) upgrade npm packages npm install npm@latest -g
  4. Re-install packages by running `npm install'
  5. Try again to run gatsby develop on your terminal/cmd. Good luck and happy coding again 👏

@rturk
Copy link

rturk commented Jan 17, 2019

Maybe this can help anyone hitting this bug

At least for us this was caused due to an old python version, once we've upgraded it we're able to move forward.

@dzonib
Copy link

dzonib commented Jan 30, 2019

Use stable version of node, not latest. That fixed errors for me.

@elibenton
Copy link

Hi all, I am running into a remarkably similar issue, but while trying to download gatsby-plugin-feed.

This is my first time developing with Gatsby, so apologies if the issue is obvious and I just don't know where to look.

result of gatsby develop

success delete html and css files from previous builds — 0.008 s
success open and validate gatsby-config — 0.005 s
success copy gatsby files — 0.019 s
success onPreBootstrap — 0.660 s
success source and transform nodes — 0.082 s
success building schema — 0.148 s
success createLayouts — 0.009 s
success createPages — 0.030 s
success createPagesStatefully — 0.026 s
success onPreExtractQueries — 0.001 s
success update schema — 0.101 s
success extract queries from components — 0.118 s
success run graphql queries — 0.044 s
success write out page data — 0.004 s
success write out redirect data — 0.001 s
success onPostBootstrap — 0.001 s

info bootstrap finished - 4.307617022 s

error There was an error compiling the html.js component for the development server.

See our docs page on debugging HTML builds for help https://goo.gl/yL9lND


  Error: Module not found: Error: Cannot resolve module 'gatsby' in /Users/elicohen/watson-website/node_modules/gatsby-plugin-feed
  resolve module gatsby in /Users/elicohen/watson-website/node_modules/gatsby-plugin-feed
    looking for modules in /Users/elicohen/watson-website/node_modules/gatsby/node_modules
      /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby doesn't exist (module as directory)
      resolve 'file' gatsby in /Users/elicohen/watson-website/node_modules/gatsby/node_modules
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.js doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.jsx doesn't exist
    looking for modules in /Users/elicohen/watson-website/node_modules/gatsby/node_modules
      /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby doesn't exist (module as directory)
      resolve 'file' gatsby in /Users/elicohen/watson-website/node_modules/gatsby/node_modules
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.js doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.jsx doesn't exist
    looking for modules in /Users/elicohen/watson-website/node_modules/gatsby/node_modules
      /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby doesn't exist (module as directory)
      resolve 'file' gatsby in /Users/elicohen/watson-website/node_modules/gatsby/node_modules
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.js doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.jsx doesn't exist
    looking for modules in /Users/elicohen/watson-website/node_modules/gatsby/node_modules
      /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby doesn't exist (module as directory)
      resolve 'file' gatsby in /Users/elicohen/watson-website/node_modules/gatsby/node_modules
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.js doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.jsx doesn't exist
    looking for modules in /Users/elicohen/watson-website/node_modules/gatsby/node_modules
      /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby doesn't exist (module as directory)
      resolve 'file' gatsby in /Users/elicohen/watson-website/node_modules/gatsby/node_modules
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.js doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.jsx doesn't exist
    looking for modules in /Users/elicohen/watson-website/node_modules/gatsby/node_modules
      /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby doesn't exist (module as directory)
      resolve 'file' gatsby in /Users/elicohen/watson-website/node_modules/gatsby/node_modules
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.js doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.jsx doesn't exist
    looking for modules in /Users/elicohen/node_modules
      /Users/elicohen/node_modules/gatsby doesn't exist (module as directory)
      resolve 'file' gatsby in /Users/elicohen/node_modules
        resolve file
          /Users/elicohen/node_modules/gatsby doesn't exist
          /Users/elicohen/node_modules/gatsby.js doesn't exist
          /Users/elicohen/node_modules/gatsby.jsx doesn't exist
    looking for modules in /Users/elicohen/watson-website/node_modules/gatsby-plugin-feed/node_modules
      /Users/elicohen/watson-website/node_modules/gatsby-plugin-feed/node_modules/gatsby doesn't exist (module as directory)
      resolve 'file' gatsby in /Users/elicohen/watson-website/node_modules/gatsby-plugin-feed/node_modules
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby-plugin-feed/node_modules/gatsby doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby-plugin-feed/node_modules/gatsby.js doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby-plugin-feed/node_modules/gatsby.jsx doesn't exist
    looking for modules in /Users/elicohen/watson-website/node_modules
      resolve 'file' gatsby in /Users/elicohen/watson-website/node_modules
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby is not a file
          /Users/elicohen/watson-website/node_modules/gatsby.jsx doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby.js doesn't exist
      resolve 'file' or 'directory' /Users/elicohen/watson-website/node_modules/gatsby
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby is not a file
          /Users/elicohen/watson-website/node_modules/gatsby.jsx doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby.js doesn't exist
        resolve directory
          directory default file index
            resolve file index in /Users/elicohen/watson-website/node_modules/gatsby
              /Users/elicohen/watson-website/node_modules/gatsby/index doesn't exist
              /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist
              /Users/elicohen/watson-website/node_modules/gatsby/index.jsx doesn't exist
          use index.js from package.json
            resolve 'file' or 'directory' index.js in /Users/elicohen/watson-website/node_modules/gatsby
              resolve file
                /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist
                /Users/elicohen/watson-website/node_modules/gatsby/index.js.jsx doesn't exist
                /Users/elicohen/watson-website/node_modules/gatsby/index.js.js doesn't exist
              resolve directory
                /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist (directory default file)
                /Users/elicohen/watson-website/node_modules/gatsby/index.js/package.json doesn't exist (directory description file)
    looking for modules in /Users/elicohen/watson-website/node_modules
      resolve 'file' gatsby in /Users/elicohen/watson-website/node_modules
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby is not a file
          /Users/elicohen/watson-website/node_modules/gatsby.jsx doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby.js doesn't exist
      resolve 'file' or 'directory' /Users/elicohen/watson-website/node_modules/gatsby
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby is not a file
          /Users/elicohen/watson-website/node_modules/gatsby.jsx doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby.js doesn't exist
        resolve directory
          directory default file index
            resolve file index in /Users/elicohen/watson-website/node_modules/gatsby
              /Users/elicohen/watson-website/node_modules/gatsby/index doesn't exist
              /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist
              /Users/elicohen/watson-website/node_modules/gatsby/index.jsx doesn't exist
          use index.js from package.json
            resolve 'file' or 'directory' index.js in /Users/elicohen/watson-website/node_modules/gatsby
              resolve file
                /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist
                /Users/elicohen/watson-website/node_modules/gatsby/index.js.jsx doesn't exist
                /Users/elicohen/watson-website/node_modules/gatsby/index.js.js doesn't exist
              resolve directory
                /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist (directory default file)
                /Users/elicohen/watson-website/node_modules/gatsby/index.js/package.json doesn't exist (directory description file)
    looking for modules in /Users/elicohen/watson-website/node_modules
      resolve 'file' gatsby in /Users/elicohen/watson-website/node_modules
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby is not a file
          /Users/elicohen/watson-website/node_modules/gatsby.jsx doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby.js doesn't exist
      resolve 'file' or 'directory' /Users/elicohen/watson-website/node_modules/gatsby
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby is not a file
          /Users/elicohen/watson-website/node_modules/gatsby.jsx doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby.js doesn't exist
        resolve directory
          directory default file index
            resolve file index in /Users/elicohen/watson-website/node_modules/gatsby
              /Users/elicohen/watson-website/node_modules/gatsby/index doesn't exist
              /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist
              /Users/elicohen/watson-website/node_modules/gatsby/index.jsx doesn't exist
          use index.js from package.json
            resolve 'file' or 'directory' index.js in /Users/elicohen/watson-website/node_modules/gatsby
              resolve file
                /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist
                /Users/elicohen/watson-website/node_modules/gatsby/index.js.jsx doesn't exist
                /Users/elicohen/watson-website/node_modules/gatsby/index.js.js doesn't exist
              resolve directory
                /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist (directory default file)
                /Users/elicohen/watson-website/node_modules/gatsby/index.js/package.json doesn't exist (directory description file)
    looking for modules in /Users/elicohen/watson-website/node_modules
      resolve 'file' gatsby in /Users/elicohen/watson-website/node_modules
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby is not a file
          /Users/elicohen/watson-website/node_modules/gatsby.jsx doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby.js doesn't exist
      resolve 'file' or 'directory' /Users/elicohen/watson-website/node_modules/gatsby
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby is not a file
          /Users/elicohen/watson-website/node_modules/gatsby.jsx doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby.js doesn't exist
        resolve directory
          directory default file index
            resolve file index in /Users/elicohen/watson-website/node_modules/gatsby
              /Users/elicohen/watson-website/node_modules/gatsby/index doesn't exist
              /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist
              /Users/elicohen/watson-website/node_modules/gatsby/index.jsx doesn't exist
          use index.js from package.json
            resolve 'file' or 'directory' index.js in /Users/elicohen/watson-website/node_modules/gatsby
              resolve file
                /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist
                /Users/elicohen/watson-website/node_modules/gatsby/index.js.jsx doesn't exist
                /Users/elicohen/watson-website/node_modules/gatsby/index.js.js doesn't exist
              resolve directory
                /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist (directory default file)
                /Users/elicohen/watson-website/node_modules/gatsby/index.js/package.json doesn't exist (directory description file)
    looking for modules in /Users/elicohen/watson-website/node_modules
      resolve 'file' gatsby in /Users/elicohen/watson-website/node_modules
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby is not a file
          /Users/elicohen/watson-website/node_modules/gatsby.jsx doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby.js doesn't exist
      resolve 'file' or 'directory' /Users/elicohen/watson-website/node_modules/gatsby
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby is not a file
          /Users/elicohen/watson-website/node_modules/gatsby.jsx doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby.js doesn't exist
        resolve directory
          directory default file index
            resolve file index in /Users/elicohen/watson-website/node_modules/gatsby
              /Users/elicohen/watson-website/node_modules/gatsby/index doesn't exist
              /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist
              /Users/elicohen/watson-website/node_modules/gatsby/index.jsx doesn't exist
          use index.js from package.json
            resolve 'file' or 'directory' index.js in /Users/elicohen/watson-website/node_modules/gatsby
              resolve file
                /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist
                /Users/elicohen/watson-website/node_modules/gatsby/index.js.jsx doesn't exist
                /Users/elicohen/watson-website/node_modules/gatsby/index.js.js doesn't exist
              resolve directory
                /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist (directory default file)
                /Users/elicohen/watson-website/node_modules/gatsby/index.js/package.json doesn't exist (directory description file)
    looking for modules in /Users/elicohen/watson-website/node_modules
      resolve 'file' gatsby in /Users/elicohen/watson-website/node_modules
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby is not a file
          /Users/elicohen/watson-website/node_modules/gatsby.jsx doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby.js doesn't exist
      resolve 'file' or 'directory' /Users/elicohen/watson-website/node_modules/gatsby
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby is not a file
          /Users/elicohen/watson-website/node_modules/gatsby.jsx doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby.js doesn't exist
        resolve directory
          directory default file index
            resolve file index in /Users/elicohen/watson-website/node_modules/gatsby
              /Users/elicohen/watson-website/node_modules/gatsby/index doesn't exist
              /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist
              /Users/elicohen/watson-website/node_modules/gatsby/index.jsx doesn't exist
          use index.js from package.json
            resolve 'file' or 'directory' index.js in /Users/elicohen/watson-website/node_modules/gatsby
              resolve file
                /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist
                /Users/elicohen/watson-website/node_modules/gatsby/index.js.jsx doesn't exist
                /Users/elicohen/watson-website/node_modules/gatsby/index.js.js doesn't exist
              resolve directory
                /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist (directory default file)
                /Users/elicohen/watson-website/node_modules/gatsby/index.js/package.json doesn't exist (directory description file)
    looking for modules in /Users/elicohen/watson-website/node_modules
      resolve 'file' gatsby in /Users/elicohen/watson-website/node_modules
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby is not a file
          /Users/elicohen/watson-website/node_modules/gatsby.jsx doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby.js doesn't exist
      resolve 'file' or 'directory' /Users/elicohen/watson-website/node_modules/gatsby
        resolve file
          /Users/elicohen/watson-website/node_modules/gatsby is not a file
          /Users/elicohen/watson-website/node_modules/gatsby.jsx doesn't exist
          /Users/elicohen/watson-website/node_modules/gatsby.js doesn't exist
        resolve directory
          directory default file index
            resolve file index in /Users/elicohen/watson-website/node_modules/gatsby
              /Users/elicohen/watson-website/node_modules/gatsby/index doesn't exist
              /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist
              /Users/elicohen/watson-website/node_modules/gatsby/index.jsx doesn't exist
          use index.js from package.json
            resolve 'file' or 'directory' index.js in /Users/elicohen/watson-website/node_modules/gatsby
              resolve file
                /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist
                /Users/elicohen/watson-website/node_modules/gatsby/index.js.jsx doesn't exist
                /Users/elicohen/watson-website/node_modules/gatsby/index.js.js doesn't exist
              resolve directory
                /Users/elicohen/watson-website/node_modules/gatsby/index.js doesn't exist (directory default file)
                /Users/elicohen/watson-website/node_modules/gatsby/index.js/package.json doesn't exist (directory description file)
  [/Users/elicohen/watson-website/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/node_modules/gatsby.jsx]
  [/Users/elicohen/node_modules/gatsby]
  [/Users/elicohen/node_modules/gatsby]
  [/Users/elicohen/node_modules/gatsby.js]
  [/Users/elicohen/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby-plugin-feed/node_modules/gatsby]
  [/Users/elicohen/watson-website/node_modules/gatsby-plugin-feed/node_modules/gatsby]
  [/Users/elicohen/watson-website/node_modules/gatsby-plugin-feed/node_modules/gatsby.js]
  [/Users/elicohen/watson-website/node_modules/gatsby-plugin-feed/node_modules/gatsby.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/index]
  [/Users/elicohen/watson-website/node_modules/gatsby/index]
  [/Users/elicohen/watson-website/node_modules/gatsby/index]
  [/Users/elicohen/watson-website/node_modules/gatsby/index]
  [/Users/elicohen/watson-website/node_modules/gatsby/index]
  [/Users/elicohen/watson-website/node_modules/gatsby/index]
  [/Users/elicohen/watson-website/node_modules/gatsby/index]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js.jsx]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js.js]
  [/Users/elicohen/watson-website/node_modules/gatsby/index.js.js]
   @ ./~/gatsby-plugin-feed/gatsby-ssr.js 9:14-31

package.json

{
	"name": "watson-wesbite",
	"description": "Traveling the world",
	"version": "1.1.3",
	"author": "Eli Benton Cohen",
	"dependencies": {
		"gatsby": "^1.9.273",
		"gatsby-link": "^1.6.37",
		"gatsby-plugin-feed": "^2.1.0",
		"gatsby-plugin-netlify": "^1.0.19",
		"gatsby-plugin-netlify-cms": "^1.0.9",
		"gatsby-plugin-react-helmet": "^2.0.5",
		"gatsby-plugin-sass": "^1.0.17",
		"gatsby-plugin-sharp": "^1.6.48",
		"gatsby-plugin-styled-components": "^2.0.11",
		"gatsby-remark-images": "^1.5.50",
		"gatsby-source-filesystem": "^1.5.23",
		"gatsby-transformer-remark": "^1.7.44",
		"gatsby-transformer-sharp": "^1.6.27",
		"immutable": "^3.8.2",
		"lodash": "^4.17.5",
		"lodash-webpack-plugin": "^0.11.4",
		"netlify-cms": "^1.7.0",
		"prop-types": "^15.6.0",
		"react": "^16.4.1",
		"react-flexbox-grid": "^2.1.2",
		"react-helmet": "^5.2.0",
		"slate": "^0.34.2",
		"styled-components": "^3.3.3",
		"uuid": "^3.2.1"
	},
	"keywords": [
		"gatsby"
	],
	"license": "MIT",
	"main": "n/a",
	"scripts": {
		"start": "npm run develop",
		"build": "gatsby build",
		"develop": "gatsby develop",
		"serve": "gatsby serve",
		"format": "prettier --trailing-comma es5 --no-semi --single-quote --write \"{gatsby-*.js,src/**/*.js}\"",
		"test": "echo \"Error: no test specified\" && exit 1"
	},
	"devDependencies": {
		"prettier": "^1.7.4"
	}
}

gatsby-config.js

module.exports = {
	siteMetadata: {
		title: `Eli Benton Cohen`,
		tagline: `Traveling the world to understand the politics of digitally networked life`
	},
	plugins: [
		{
			resolve: `gatsby-plugin-feed`,
			options: {
				query: `
          {
            site {
              siteMetadata {
                title
                description
                siteUrl
                site_url: siteUrl
              }
            }
          }
        `,
				feeds: [
					{
						serialize: ({ query: { site, allMarkdownRemark } }) => {
							return allMarkdownRemark.edges.map(edge => {
								return Object.assign({}, edge.node.frontmatter, {
									description: edge.node.excerpt,
									date: edge.node.frontmatter.date,
									url: site.siteMetadata.siteUrl + edge.node.fields.slug,
									guid: site.siteMetadata.siteUrl + edge.node.fields.slug,
									custom_elements: [{ "content:encoded": edge.node.html }]
								});
							});
						},
						query: `
              {
                allMarkdownRemark( sort: { order: DESC, fields: [frontmatter___date] },
                ) {
                  edges {
                    node {
                      excerpt
                      html
                      fields { slug }
                      frontmatter {
                        title
                        date
                      }
                    }
                  }
                }
              }
            `,
						output: "/rss.xml",
						title: "Your Site's RSS Feed"
					}
				]
			}
		},
		`gatsby-plugin-react-helmet`,
		`gatsby-plugin-styled-components`,
		{
			resolve: `gatsby-source-filesystem`,
			options: {
				path: `${__dirname}/src/pages`,
				name: `pages`
			}
		},
		`gatsby-plugin-sharp`,
		`gatsby-transformer-sharp`,
		{
			resolve: `gatsby-transformer-remark`,
			options: {
				plugins: []
			}
		},
		{
			resolve: `gatsby-plugin-netlify-cms`,
			options: {
				modulePath: `${__dirname}/src/cms/cms.js`
			}
		},
		`gatsby-plugin-netlify` // make sure to keep it last in the array
	]
};

I've tried every combination of deleting node_modules, .cache, public I can find. I've tried yarn and npm. Seems to throw the same error every time.

Any help is appreciated. Thanks so much.

@Raphjacksun7
Copy link

Try this command it work for me npm install sharp --unsafe-perm

@CodeAmend
Copy link

@Raphjacksun7 Nice. Netlify was giving me trouble, not my local machine, no matter what node version and deleting of node modules. So installing sharp manually was key.

@MoliseMG
Copy link

@Raphjacksun7 Nice. Netlify was giving me trouble, not my local machine, no matter what node version and deleting of node modules. So installing sharp manually was key.

how do you add sharp manually?

krtb pushed a commit to krtb/kurtbauer that referenced this issue Oct 24, 2019
tracking of issue can found here: gatsbyjs/gatsby#4693
@theolebarq
Copy link

Thanks @Raphjacksun7 the command npm install sharp --unsafe-perm work for me.

@bartTC
Copy link

bartTC commented Nov 16, 2019

I did set npm config set ignore-scripts true globally so the sharp library wasn't compiled by it's postinstall script.

Putting it back to false (the default) and deleting node_modules/sharp and reinstalling fixed it.

@Nuhvi
Copy link

Nuhvi commented Nov 17, 2019

@bartTC Thanks, this haunted me for a whole night, still, "npm config set ignore-scripts true" is very important, is there any workaround?

@Raphjacksun7
Copy link

@Raphjacksun7 Nice. Netlify was giving me trouble, not my local machine, no matter what node version and deleting of node modules. So installing sharp manually was key.

Exactly !

@Raphjacksun7
Copy link

Thanks @Raphjacksun7 the command npm install sharp --unsafe-perm work for me.

You're welcome

@huy-nguyen
Copy link

huy-nguyen commented Jun 2, 2020

If anyone runs into this problem after updating Mac OS and the other solutions don't work, the reason might be that your Xcode commandline tools need to be reinstalled. https://anansewaa.com/gyp-no-xcode-or-clt-version-detected-macos-catalina/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests