Bycrypt节点模块无法在我的M1 MacBook上使用
好的,所以我几天前用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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我在M1 MacBook上使用节点V14遇到了同样的问题。
对我而言,切换到节点V16解决了问题。如果您使用的是NVM,则可以写:
也可能与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:
Might work with node v18 as well - hope this helps!