Running npm run dev
(gatsby develop
) 在 MacBook Pro M1 芯片上退出 Error: Something went wrong installing the "sharp" module
Running npm run dev
MacBook Pro 的英特尔芯片工作正常。
我看过类似的帖子,但没有解决我的问题:
- 当我运行“gatsbydevelopment”时,安装“sharp”模块出现错误,显示错误 https://stackoverflow.com/questions/60317121/when-i-run-gatsby-develop-something-went-wrong-installing-the-sharp-module
- 安装 Gatsby Starter 时出错“安装“sharp”模块时出错” https://stackoverflow.com/questions/63997253/error-installing-gatsby-starter-something-went-wrong-installing-the-sharp-mod
- Gatsby Develop:安装“sharp”模块时出错 https://stackoverflow.com/questions/64233792/gatsby-develop-something-went-wrong-installing-the-sharp-module
我已经更新了我的节点版本,以防进行任何修复,但仍然出现错误node v16.0.0
On this github问题 https://github.com/gatsbyjs/gatsby/issues/20957#issuecomment-579414671他们建议按照这些步骤操作,但没有成功。
rm -r node_modules/sharp
yarn install --check-files
On this github问题 https://github.com/gatsbyjs/gatsby/issues/24559他们建议安装NVM
并降级节点版本。 NVM 在我的 M1 芯片上安装有一些困难,所以它对我来说不是一个好的选择。
我也尝试过执行以下步骤,但效果不佳
rm -rf node_module
rm package-lock.json
npm i
知道我能做什么来修复吗gatsby develop
在M1芯片上?
按照以下步骤从这次讨论 https://github.com/gatsbyjs/gatsby/discussions/29891解决了我的问题。
xcode-select --install
brew install gcc
brew reinstall vips
brew info vips
npm i
然后你就可以运行gatsby develop
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)