运行测试时“../bcrypt_lib.node”(mach-o 文件,但是不兼容的架构(有(arm64),需要(x86_64)))”

Shr*_*oor 9 macos-monterey

1

Error: dlopen(/Users//Documents/Work/Repo/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node, 0x0001): tried: '/Users//Documents/Work/Repo/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node' (mach-o file, but is an incompatible architecture (have (arm64), need (x86_64)))
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:14)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:92:18)
at Object.<anonymous> (/Users/Documents/Work/node_modules/bcrypt/bcrypt.js:6:16)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Object.require.extensions.<computed> [as .js] (/Users//Documents/Work/Repo///node_modules/ts-node/src/index.ts:431:14)
Run Code Online (Sandbox Code Playgroud)

任何想法如何解决这个问题,这里是新的。请让我知道此处需要的任何其他信息。

小智 5

我遇到了类似的错误,对我有用的是将我的节点版本升级到更高版本。我在节点版本上遇到错误v14.16.1,但随后升级到该版本v16.16.0,问题就消失了。另外,如果您使用的是 Mac M1,也许请确保您使用的是 Rosetta。


归档时间:

查看次数:

6481 次

最近记录:

2 年,5 月 前