Bycrypt节点模块无法在我的M1 MacBook上使用

发布于 2025-02-06 02:39:03 字数 1689 浏览 2 评论 0原文

好的,所以我几天前用M1购买了MacBook Air 2020,直到我尝试从Github进口我的作品以开始在笔记本电脑上工作,安装了所有内容并解决了大多数问题't工作给我这个错误

Error: dlopen(/Users/jaberghanem/Desktop/innentialApp/backend/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node, 0x0001): tried: '/Users/jaberghanem/Desktop/innentialApp/backend/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:1057:18)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/Users/jaberghanem/Desktop/innentialApp/backend/node_modules/bcrypt/bcrypt.js:6:16)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Object.require.extensions.<computed> [as .js] (/Users/jaberghanem/Desktop/innentialApp/backend/node_modules/babel-register/lib/node.js:152:7)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/Users/jaberghanem/Desktop/innentialApp/backend/src/utils/encryption/_encryptor.js:1:1)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at loader (/Users/jaberghanem/Desktop/innentialApp/backend/node_modules/babel-register/lib/node.js:144:5)

[nodemon]应用程序崩溃了 - 启动之前等待文件更改...

Ok so I bought this MacBook Air 2020 with the m1 a few days ago and it's been fine until I tried to import my work from GitHub to start working on it on the laptop, installed everything and fixed most issues but now it seems like it doesn't work it gives me this error

Error: dlopen(/Users/jaberghanem/Desktop/innentialApp/backend/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node, 0x0001): tried: '/Users/jaberghanem/Desktop/innentialApp/backend/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:1057:18)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/Users/jaberghanem/Desktop/innentialApp/backend/node_modules/bcrypt/bcrypt.js:6:16)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Object.require.extensions.<computed> [as .js] (/Users/jaberghanem/Desktop/innentialApp/backend/node_modules/babel-register/lib/node.js:152:7)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/Users/jaberghanem/Desktop/innentialApp/backend/src/utils/encryption/_encryptor.js:1:1)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at loader (/Users/jaberghanem/Desktop/innentialApp/backend/node_modules/babel-register/lib/node.js:144:5)

[nodemon] app crashed - waiting for file changes before starting...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

青衫负雪 2025-02-13 02:39:03

我在M1 MacBook上使用节点V14遇到了同样的问题。

对我而言,切换到节点V16解决了问题。如果您使用的是NVM,则可以写:

nvm install 16

nvm use 16

也可能与Node V18一起使用 - 希望这会有所帮助!

I had the same issue on my M1 Macbook with node v14.

For me switching to node v16 solved the issue. If you're using nvm, you can write:

nvm install 16

nvm use 16

Might work with node v18 as well - hope this helps!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文