【Node】m1 mac 使用 nvm 安装 node v14 报错

2024-08-27 02:36
文章标签 安装 使用 mac 报错 node m1 nvm v14

本文主要是介绍【Node】m1 mac 使用 nvm 安装 node v14 报错,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

author: jayzhen
date: 20240826

报错内容

  • nvm 0.39.3
  • macbook m1pro os14.6.1
v8_compiler/deps/v8/src/compiler/backend/instruction-selector.o.d.raw   -c
In file included from ../deps/v8/src/compiler/backend/frame-elider.cc:5:
In file included from ../deps/v8/src/compiler/backend/frame-elider.h:8:
In file included from ../deps/v8/src/compiler/backend/instruction.h:14:
In file included from ../deps/v8/src/codegen/external-reference.h:9:
In file included from ../deps/v8/src/runtime/runtime.h:11:
../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion]static constexpr T kMax = static_cast<T>(kNumValues - 1);^
In file included from ../deps/v8/src/compiler/backend/instruction-scheduler.cc:5:
In file included from ../deps/v8/src/compiler/backend/instruction-scheduler.h:9:
In file included from ../deps/v8/src/compiler/backend/instruction.h:14:
In file included from ../deps/v8/src/codegen/external-reference.h:9:
In file included from ../deps/v8/src/runtime/runtime.h:11:
../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion]static constexpr T kMax = static_cast<T>(kNumValues - 1);^
In file included from ../deps/v8/src/compiler/backend/code-generator.cc:5:
In file included from ../deps/v8/src/compiler/backend/code-generator.h:11:
In file included from ../deps/v8/src/codegen/macro-assembler.h:8:
In file included from ../deps/v8/src/codegen/turbo-assembler.h:12:
In file included from ../deps/v8/src/codegen/assembler-arch.h:8:
In file included from ../deps/v8/src/codegen/assembler.h:45:
In file included from ../deps/v8/src/codegen/external-reference.h:9:
In file included from ../deps/v8/src/runtime/runtime.h:11:
../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion]static constexpr T kMax = static_cast<T>(kNumValues - 1);
  • ../deps/v8/src/base/bit-field.h:43:29: error: integer value 31 is outside the valid range of values [0, 15] for this enumeration type [-Wenum-constexpr-conversion]

解决方案

Node v14 不支持 ARM64,因此nvm无法找到支持的二进制文件,并尝试构建源代码(也失败了)

为了在具有 arm64 的 Mac 上安装 v14,您需要使用 Rosseta。
您可以Rosseta使用以下命令进行安装:

/usr/sbin/softwareupdate --install-rosetta --agree-to-license

nvm在更改以下内容后将允许运行安装arch (也可以只执行这个,不用上面内容):

arch -x86_64 zsh
nvm install 14.21.3

参考

  • https://github.com/nodejs/node/issues/52306
  • https://github.com/web3/web3.js/issues/3408

这篇关于【Node】m1 mac 使用 nvm 安装 node v14 报错的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/1110385

相关文章

Java使用Curator进行ZooKeeper操作的详细教程

《Java使用Curator进行ZooKeeper操作的详细教程》ApacheCurator是一个基于ZooKeeper的Java客户端库,它极大地简化了使用ZooKeeper的开发工作,在分布式系统... 目录1、简述2、核心功能2.1 CuratorFramework2.2 Recipes3、示例实践3

springboot security使用jwt认证方式

《springbootsecurity使用jwt认证方式》:本文主要介绍springbootsecurity使用jwt认证方式,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地... 目录前言代码示例依赖定义mapper定义用户信息的实体beansecurity相关的类提供登录接口测试提供一

go中空接口的具体使用

《go中空接口的具体使用》空接口是一种特殊的接口类型,它不包含任何方法,本文主要介绍了go中空接口的具体使用,具有一定的参考价值,感兴趣的可以了解一下... 目录接口-空接口1. 什么是空接口?2. 如何使用空接口?第一,第二,第三,3. 空接口几个要注意的坑坑1:坑2:坑3:接口-空接口1. 什么是空接

springboot security快速使用示例详解

《springbootsecurity快速使用示例详解》:本文主要介绍springbootsecurity快速使用示例,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝... 目录创www.chinasem.cn建spring boot项目生成脚手架配置依赖接口示例代码项目结构启用s

Python如何使用__slots__实现节省内存和性能优化

《Python如何使用__slots__实现节省内存和性能优化》你有想过,一个小小的__slots__能让你的Python类内存消耗直接减半吗,没错,今天咱们要聊的就是这个让人眼前一亮的技巧,感兴趣的... 目录背景:内存吃得满满的类__slots__:你的内存管理小助手举个大概的例子:看看效果如何?1.

java中使用POI生成Excel并导出过程

《java中使用POI生成Excel并导出过程》:本文主要介绍java中使用POI生成Excel并导出过程,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录需求说明及实现方式需求完成通用代码版本1版本2结果展示type参数为atype参数为b总结注:本文章中代码均为

Spring Boot3虚拟线程的使用步骤详解

《SpringBoot3虚拟线程的使用步骤详解》虚拟线程是Java19中引入的一个新特性,旨在通过简化线程管理来提升应用程序的并发性能,:本文主要介绍SpringBoot3虚拟线程的使用步骤,... 目录问题根源分析解决方案验证验证实验实验1:未启用keep-alive实验2:启用keep-alive扩展建

MySQL Workbench 安装教程(保姆级)

《MySQLWorkbench安装教程(保姆级)》MySQLWorkbench是一款强大的数据库设计和管理工具,本文主要介绍了MySQLWorkbench安装教程,文中通过图文介绍的非常详细,对大... 目录前言:详细步骤:一、检查安装的数据库版本二、在官网下载对应的mysql Workbench版本,要是

SpringBoot启动报错的11个高频问题排查与解决终极指南

《SpringBoot启动报错的11个高频问题排查与解决终极指南》这篇文章主要为大家详细介绍了SpringBoot启动报错的11个高频问题的排查与解决,文中的示例代码讲解详细,感兴趣的小伙伴可以了解一... 目录1. 依赖冲突:NoSuchMethodError 的终极解法2. Bean注入失败:No qu

使用Java实现通用树形结构构建工具类

《使用Java实现通用树形结构构建工具类》这篇文章主要为大家详细介绍了如何使用Java实现通用树形结构构建工具类,文中的示例代码讲解详细,感兴趣的小伙伴可以跟随小编一起学习一下... 目录完整代码一、设计思想与核心功能二、核心实现原理1. 数据结构准备阶段2. 循环依赖检测算法3. 树形结构构建4. 搜索子