apache / apache/pulsar-client-node

Cannot find module 'pulsar-client@1.12.0' by pnpm

オープン
#403 コメント 4 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
C++
スター
164
フォーク
98
PR マージ指標
30日以内にマージされた PR はありません

説明

I tried to migrate an old project from `NPM` to `PNPM`, but after running `pnpm install`, when I try to start the project, I encounter a `MODULE_NOT_FOUND` error. How can I fix this issue?

```
node:internal/modules/cjs/loader:1247
throw err;
^

Error: Cannot find module '/Users/user/Desktop/project/frontend-websocket-api/node_modules/.pnpm/pulsar-client@1.12.0/node_modules/pulsar-client/lib/binding/pulsar.node'
Require stack:
- /Users/user/Desktop/project/frontend-websocket-api/node_modules/.pnpm/pulsar-client@1.12.0/node_modules/pulsar-client/src/pulsar-binding.js
- /Users/user/Desktop/project/frontend-websocket-api/node_modules/.pnpm/pulsar-client@1.12.0/node_modules/pulsar-client/index.js
- /Users/user/Desktop/project/frontend-websocket-api/dist/config/pulsar/pulsar.service.js
- /Users/user/Desktop/project/frontend-websocket-api/dist/gateway/pulsar-socket-frontend-service.js
- /Users/user/Desktop/project/frontend-websocket-api/dist/gateway/payment-pulsar-socket-impl/payment-pulsar-socket-impl.module.js
- /Users/user/Desktop/project/frontend-websocket-api/dist/gateway/gateway.module.js
- /Users/user/Desktop/project/frontend-websocket-api/dist/app.module.js
- /Users/user/Desktop/project/frontend-websocket-api/dist/main.js
at Function._resolveFilename (node:internal/modules/cjs/loader:1244:15)
at Function._load (node:internal/modules/cjs/loader:1070:27)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
at Module.require (node:internal/modules/cjs/loader:1335:12)
at require (node:internal/modules/helpers:136:16)
at Object. (/Users/user/Desktop/project/frontend-websocket-api/node_modules/.pnpm/pulsar-client@1.12.0/node_modules/pulsar-client/src/pulsar-binding.js:24:17)
at Module._compile (node:internal/modules/cjs/loader:1562:14)
at Object..js (node:internal/modules/cjs/loader:1699:10)
at Module.load (node:internal/modules/cjs/loader:1313:32) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/user/Desktop/project/frontend-websocket-api/node_modules/.pnpm/pulsar-client@1.12.0/node_modules/pulsar-client/src/pulsar-binding.js',
'/Users/user/Desktop/project/frontend-websocket-api/node_modules/.pnpm/pulsar-client@1.12.0/node_modules/pulsar-client/index.js',
'/Users/user/Desktop/project/frontend-websocket-api/dist/config/pulsar/pulsar.service.js',
'/Users/user/Desktop/project/frontend-websocket-api/dist/gateway/pulsar-socket-frontend-service.js',
'/Users/user/Desktop/project/frontend-websocket-api/dist/gateway/payment-pulsar-socket-impl/payment-pulsar-socket-impl.module.js',
'/Users/user/Desktop/project/frontend-websocket-api/dist/gateway/gateway.module.js',
'/Users/user/Desktop/project/frontend-websocket-api/dist/app.module.js',
'/Users/user/Desktop/project/frontend-websocket-api/dist/main.js'
]
}

```

Node.js v22.13.1
pnpm v10.4.1

- [x] Mac OS
- [x] ubuntu

[Cannot find module 'pulsar-client@1.12.0' by pnpm](https://stackoverflow.com/questions/79447727/cannot-find-module-pulsar-client1-12-0-by-pnpm)

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start by reproducing pnpm install and project startup with Node.js 22.13.1 and pnpm 10.4.1 on macOS or Ubuntu, then inspect pulsar-client/src/pulsar-binding.js and the missing lib/binding/pulsar.node path. Done means the native binding is available and the client starts without MODULE_NOT_FOUND.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript, nodejs
領域
build-system
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
活発
明瞭さ
説明が足りない
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。