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

打印 上一主题 下一主题

主题 245|帖子 245|积分 735

author: jayzhen
date: 20240826
  报错内容



  • nvm 0.39.3
  • macbook m1pro os14.6.1
  1. v8_compiler/deps/v8/src/compiler/backend/instruction-selector.o.d.raw   -c
  2. In file included from ../deps/v8/src/compiler/backend/frame-elider.cc:5:
  3. In file included from ../deps/v8/src/compiler/backend/frame-elider.h:8:
  4. In file included from ../deps/v8/src/compiler/backend/instruction.h:14:
  5. In file included from ../deps/v8/src/codegen/external-reference.h:9:
  6. In file included from ../deps/v8/src/runtime/runtime.h:11:
  7. ../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]
  8.   static constexpr T kMax = static_cast<T>(kNumValues - 1);
  9.                             ^
  10. In file included from ../deps/v8/src/compiler/backend/instruction-scheduler.cc:5:
  11. In file included from ../deps/v8/src/compiler/backend/instruction-scheduler.h:9:
  12. In file included from ../deps/v8/src/compiler/backend/instruction.h:14:
  13. In file included from ../deps/v8/src/codegen/external-reference.h:9:
  14. In file included from ../deps/v8/src/runtime/runtime.h:11:
  15. ../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]
  16.   static constexpr T kMax = static_cast<T>(kNumValues - 1);
  17.                             ^
  18. In file included from ../deps/v8/src/compiler/backend/code-generator.cc:5:
  19. In file included from ../deps/v8/src/compiler/backend/code-generator.h:11:
  20. In file included from ../deps/v8/src/codegen/macro-assembler.h:8:
  21. In file included from ../deps/v8/src/codegen/turbo-assembler.h:12:
  22. In file included from ../deps/v8/src/codegen/assembler-arch.h:8:
  23. In file included from ../deps/v8/src/codegen/assembler.h:45:
  24. In file included from ../deps/v8/src/codegen/external-reference.h:9:
  25. In file included from ../deps/v8/src/runtime/runtime.h:11:
  26. ../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]
  27.   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使用以下命令举行安装:
  1. /usr/sbin/softwareupdate --install-rosetta --agree-to-license
复制代码
nvm在更改以下内容后将允许运行安装arch (也可以只执行这个,不消上面内容):
  1. arch -x86_64 zsh
  2. nvm install 14.21.3
复制代码
参考



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

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
回复

使用道具 举报

0 个回复

倒序浏览

快速回复

您需要登录后才可以回帖 登录 or 立即注册

本版积分规则

梦应逍遥

高级会员
这个人很懒什么都没写!

标签云

快速回复 返回顶部 返回列表