【问题标题】:I cannot install gatsby-plugin-sharp我无法安装 gatsby-plugin-sharp
【发布时间】:2020-09-01 01:48:45
【问题描述】:
   npm i gatsby-plugin-sharp

尝试在我的 Windows7 32bit 上安装 gatsby-plugin-sharp 但遇到此错误

npm ERR!
npm ERR! Failed at the pngquant-bin@5.0.2 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional
logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Qudusayo\AppData\Roaming\npm-cache\_logs\2020-05-23T08_58_04_544Z-debug.log

【问题讨论】:

  • 嘿 Qudusayo。欢迎来到stackoverflow。您需要为您的问题提供更多详细信息,以便人们更好地回答您的问题!
  • 可能缺少 libpng。谷歌结合你的操作系统。
  • 您在设置本地环境时是否遵循Gatsby on Windows 指南?

标签: npm gatsby


【解决方案1】:

试试:

npm install --global windows-build-tools

然后,再次安装gatsby-plugin-sharp

   npm i gatsby-plugin-sharp

资源:

【讨论】:

    【解决方案2】:

    在我的机器上,建议的解决方案不起作用。在过去的几天里,我尝试了许多不同的方法。唯一安装了插件的是以下(Windows):

    1. 检查ignore-scripts是否没有全局设置为false:

      npm config set ignore-scripts true
      
    2. node_modules

      中删除旧的 sharp 文件夹
    3. 重新安装为:

      npm install sharp --unsafe-perm
      
    4. 如果上面的方法不起作用,试试这个

      npm rebuild --verbose sharp 
      

    编码愉快!您可以参考this link

    【讨论】:

      猜你喜欢
      • 2021-06-16
      • 1970-01-01
      • 2020-02-11
      • 2021-07-01
      • 2019-04-02
      • 2019-05-27
      • 2021-06-04
      • 1970-01-01
      • 2019-08-17
      相关资源
      最近更新 更多