MAC M1 安装“sharp"时出了点问题模块 [英] MAC M1 Something went wrong installing the "sharp" module

查看:262
本文介绍了MAC M1 安装“sharp"时出了点问题模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 MacBook Pro M1 芯片上运行 npm run dev (gatsby develop) 退出并显示 错误:安装sharp"时出现问题模块

运行 npm run dev MacBook Pro intel 芯片工作正常.

我看过类似的帖子,但没有解决我的问题:

我已经更新了我的节点版本,以防有任何修复,但我仍然在 node v16.0.0

上遇到错误

在这个 github 问题上,他们建议遵循以下步骤没有用.

<块引用>

rm -r node_modules/sharp纱线安装 --check-files

在这个 github 问题上,他们建议安装 NVM 和降级节点版本.在我的 M1 芯片上安装 NVM 有一些困难,所以它对我来说不是一个好的选择.

我也尝试过以下步骤,但效果不佳

rm -rf node_modulerm 包-lock.json我的

知道我可以做些什么来使 gatsby develop 在 M1 芯片上简单工作吗?

解决方案

按照 this 中的这些步骤操作问题解决了我的问题.

  1. xcode-select --install
  2. brew install gcc
  3. brew 重新安装 vips
  4. brew info vips
  5. npm i

然后就可以运行gatsby develop

Running npm run dev (gatsby develop) on MacBook Pro M1 chip exit with Error: Something went wrong installing the "sharp" module

Running npm run dev MacBook Pro intel chip works fine.

I've seen similar post which did not solved my problem :

I've update my node version in case any fixes had been made but I still got the error on node v16.0.0

On this github issue they recommend to follow theses steps which did not work.

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

On this github issue they recommend to install NVM and downgrade node version. NVM has some difficulties to install on my M1 chip so it is not a good option for me.

I have also tried to do the following steps which did not work as well

rm -rf node_module
rm package-lock.json
npm i 

Any idea what I can do to make simply work gatsby develop on M1 chip ?

解决方案

Following these steps from this issue solved my problem.

  1. xcode-select --install
  2. brew install gcc
  3. brew reinstall vips
  4. brew info vips
  5. npm i

Then you can run gatsby develop

这篇关于MAC M1 安装“sharp"时出了点问题模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆