• 카테고리

    질문 & 답변
  • 세부 분야

    프론트엔드

  • 해결 여부

    미해결

[해결완료!!] Error: Something went wrong installing the "sharp" module

21.11.05 22:41 작성 조회수 3.73k

2

Error

Something went wrong installing the "sharp" module

Cannot find module '../build/Release/sharp-darwin-arm64v8.node'

 

Possible solutions:

- Install with the --verbose flag and look for errors: "npm install --ignore-scripts=false --verbose sharp"

- Install for the current runtime: "npm install --platform=darwin --arch=arm64 sharp"

- Consult the installation documentation: https://sharp.pixelplumbing.com/install

 

not finished open and validate gatsby-configs, load plugins - 0.127s

 

gatsby-config.js 

module.exports = {
  siteMetadata: {
    title: `Gatsby Default Starter`,
    description: `Kick off your next, great Gatsby project with this default starter. This barebones starter ships with the main Gatsby configuration files you might need.`,
    author: `@gatsbyjs`,
  },
  plugins: [
    {
      resolve: 'gatsby-plugin-typescript',
      options: {
        isTSX: true,
        allExtensions: true,
      },
    },
    `gatsby-plugin-react-helmet`,
    // {
    //   resolve: `gatsby-source-filesystem`,
    //   options: {
    //     name: `contents`,
    //     path: `${__dirname}/contents`,
    //   },
    // },
    `gatsby-transformer-sharp`,
    `gatsby-plugin-sharp`,
    // this (optional) plugin enables Progressive Web App + Offline functionality
    // To learn more, visit: <https://gatsby.dev/offline>
    // `gatsby-plugin-offline`,
    `gatsby-plugin-emotion`,
  ],
}

 

try...

노드버전 16.0.0으로 업그레이드 후,  yarn add --platform=darwin --arch=arm64 sharp 해보았으나, 에러가 여전히 발생합니다. 

해결 방법이 있을까요??

그리고 좋은 강의 너무도 감사합니다!

 

해결완료하였습니다. 다른 분들에게 참고가 될 수 있을 거 같아서 남겨놓아요!

  • rm -r node_modules/sharp
  • yarn install --check-files

참고자료: https://github.com/gatsbyjs/gatsby/issues/20957 

 

답변 2

·

답변을 작성해보세요.

0

미플님의 프로필

미플

2024.04.27

같은 문제를 겪었습니다. 답변 공유해 주셔서 감사합니다.

0

안녕하세요, scvd03님!

요새 질문 확인이 많이 늦어지는데 문제 해결하셨다니 정말 다행입니다

꼭 다른 분들에게 참고됐으면 좋겠습니다!