apache / apache/pulsar-client-node
Cannot find module 'pulsar-client@1.12.0' by pnpm
- Vorherrschende Sprache
- C++
- Sterne
- 164
- Forks
- 98
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
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)
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- javascript, nodejs
- Bereich
- build-system
- Issue-Typ
- Bug
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Aktivitätsstatus
- Aktiv
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 38/100