Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

M2 macOS:Cannot find module '@node-rs/jieba-darwin-x64' #713

Closed
hotoo opened this issue Sep 5, 2023 · 4 comments
Closed

M2 macOS:Cannot find module '@node-rs/jieba-darwin-x64' #713

hotoo opened this issue Sep 5, 2023 · 4 comments

Comments

@hotoo
Copy link

hotoo commented Sep 5, 2023

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'
  ]
}
@Brooooooklyn
Copy link
Member

Are you running an x64 Node.js on arm64 macOS?

@hotoo
Copy link
Author

hotoo commented Sep 5, 2023

I was download node.js by https://nodejs.org/dist/latest-v14.x/node-v14.21.3.pkg from nodejs.org homepage.

@Brooooooklyn
Copy link
Member

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.

@hotoo
Copy link
Author

hotoo commented Sep 7, 2023

@Brooooooklyn My company FE framework need me to use node 14, what can I do now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants