taro3 mac m1 Error: Node Sass does not yet support your current environment: OS X 64-bit with Uns...

taro3 mac系统 m1电脑
Error: Node Sass does not yet support your current environment: OS X 64-bit with Unsupported runtime


image.png

经排查,发现针对mac系统,有指定的node版本,https://github.com/sass/node-sass/releases/tag/v4.13.1,mac最高支持node13,而我新安装的Node版本已经到了16,所以只能使用nvm选择指定的node版本。

image.png

解决方案

MAC安装nvm
然后使用nvm安装指定的node

nvm install 12.22.2

image.png
image.png

原因:M1版MacBook不能兼容所有的X86软件
https://blog.csdn.net/weixin_37989267/article/details/111575253
https://github.com/nvm-sh/nvm/issues/2350
根据这github提升
终端执行: arch -x86_64 zsh,

image.png

再次执行 nvm install v12.22.2 ,就能成功安装node12版本了

image.png

但重新启动项目后又报错了 😓,


image.png

根据提示执行 npm rebuild node-sass


image.png

然后启动项目,终于成功了,太感人了~
image.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容