apache / apache/pulsar-client-node

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

Đang mở
#403 4 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C++
Star
164
Fork
98
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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)

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript, nodejs
Lĩnh vực
build-system
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Cần làm rõ
Mức phù hợp với người mới
38/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.