node-rs
node-rs copied to clipboard
M2 macOS:Cannot find module '@node-rs/jieba-darwin-x64'
macOS Ventura 13.4 (22F66) Apple M2 Pro
/Users/hotoo/Library/pnpm/global/5/.pnpm/@[email protected]/node_modules/@node-rs/jieba/index.js:232
throw loadError
^
Error: Cannot find module '@node-rs/jieba-darwin-x64'
Require stack:
- /Users/hotoo/Library/pnpm/global/5/.pnpm/@[email protected]/node_modules/@node-rs/jieba/index.js
- /Users/hotoo/Library/pnpm/global/5/.pnpm/[email protected]/node_modules/pinyin/lib/segment.js
- /Users/hotoo/Library/pnpm/global/5/.pnpm/[email protected]/node_modules/pinyin/lib/pinyin.js
- /Users/hotoo/Library/pnpm/global/5/.pnpm/[email protected]/node_modules/pinyin/bin/pinyin
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:931:15)
at Function.Module._load (internal/modules/cjs/loader.js:774:27)
at Module.require (internal/modules/cjs/loader.js:1003:19)
at require (internal/modules/cjs/helpers.js:107:18)
at Object.<anonymous> (/Users/hotoo/Library/pnpm/global/5/.pnpm/@[email protected]/node_modules/@node-rs/jieba/index.js:121:29)
at Module._compile (internal/modules/cjs/loader.js:1114:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
at Module.load (internal/modules/cjs/loader.js:979:32)
at Function.Module._load (internal/modules/cjs/loader.js:819:12)
at Module.require (internal/modules/cjs/loader.js:1003:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/hotoo/Library/pnpm/global/5/.pnpm/@[email protected]/node_modules/@node-rs/jieba/index.js',
'/Users/hotoo/Library/pnpm/global/5/.pnpm/[email protected]/node_modules/pinyin/lib/segment.js',
'/Users/hotoo/Library/pnpm/global/5/.pnpm/[email protected]/node_modules/pinyin/lib/pinyin.js',
'/Users/hotoo/Library/pnpm/global/5/.pnpm/[email protected]/node_modules/pinyin/bin/pinyin'
]
}
Are you running an x64 Node.js on arm64 macOS?
I was download node.js by https://nodejs.org/dist/latest-v14.x/node-v14.21.3.pkg from nodejs.org homepage.
Node.js 14 doesn't support arm64 macOS, so you are using the x64 Node.js on arm64 macOS. And the ` Error: Cannot find module '@node-rs/jieba-darwin-x64' may be due to the bug of pnpm, it doesn't install the right binaries for you.
@Brooooooklyn My company FE framework need me to use node 14, what can I do now?