apache / apache/pulsar-client-node
Cannot find module 'pulsar-client@1.12.0' by pnpm
- Lenguaje dominante
- C++
- Estrellas
- 164
- Forks
- 98
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
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)
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- javascript, nodejs
- Área
- build-system
- Tipo de issue
- Error
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Estado de actividad
- Activo
- Claridad
- Necesita aclaración
- Aptitud para principiantes
- 38/100