Open-source SaaS Starter with User Roles & Admin Panel. Built using Next.js 14, Prisma, Neon, Auth.js v5, Resend, React Email, Shadcn/ui, Stripe, Server Actions.
I'm experiencing a persistent issue with module resolution for the @opentelemetry/sdk-trace-node package in my Next.js project. The error message I receive is:
✓ Starting...
✓ Ready in 4.5s
Error: Cannot find package 'C:\Users\Desktop\next-saas-stripe-starter\nodemodules.pnpm\@effect-ts+otel-sdk-trace-node@0.15.1@effect-ts+core@0.60.5@opentelemetry+api@1.9.0@opente_gu7sgejjhhrnegyrk5qh4aibs4\node_modules\@opentelemetry\sdk-trace-node\package.json' imported from C:\Users\HUAWEI\Desktop\next-saas-stripe-starter\nodemodules.pnpm\@effect-ts+otel-sdk-trace-node@0.15.1@effect-ts+core@0.60.5@opentelemetry+api@1.9.0@opente_gu7sgejjhhrnegyrk5qh4aibs4\nodemodules\@effect-ts\otel-sdk-trace-node_mjs\index.mjs
Did you mean to import @opentelemetry+sdk-trace-node@1.25.1@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-node/build/src/index.js?
at legacyMainResolve (node:internal/modules/esm/resolve:205:26)
at packageResolve (node:internal/modules/esm/resolve:831:14)
at moduleResolve (node:internal/modules/esm/resolve:901:20)
at defaultResolve (node:internal/modules/esm/resolve:1121:11)
at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12)
at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25)
at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38)
at ModuleWrap. (node:internal/modules/esm/module_job:85:39)
at link (node:internal/modules/esm/module_job:84:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
Steps I've Tried to Resolve the Issue:
Checked the File Structure: Verified that the @opentelemetry/sdk-trace-node package did not have the build/src/index.js file in the node_modules directory.
Reinstalled the Specific Package: Attempted to reinstall @opentelemetry/sdk-trace-node using PNPM.
Tried Different Versions: Installed different versions of @opentelemetry/sdk-trace-node to see if the issue was version-specific.
Cleared Node Modules and Reinstalled: Deleted the node_modules directory and reinstalled dependencies.
Checked for Peer Dependencies: Ensured that all peer dependencies were correctly installed and compatible.
Verified Package Contents: Manually checked the contents of the package to verify the presence of the necessary files.
Used Alternative Package Managers: Tried using NPM and Yarn to install dependencies.
Cleared npm Cache: Cleared the npm cache to resolve potential corruption.
Deleted and Recreated Lock Files: Deleted package-lock.json and node_modules and reinstalled dependencies.
Reviewed Debug Logs: Reviewed npm debug logs for more detailed error information.
Hi everyone,
I'm experiencing a persistent issue with module resolution for the (node:internal/modules/esm/module_job:85:39)
at link (node:internal/modules/esm/module_job:84:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
@opentelemetry/sdk-trace-node
package in my Next.js project. The error message I receive is: ✓ Starting... ✓ Ready in 4.5s Error: Cannot find package 'C:\Users\Desktop\next-saas-stripe-starter\nodemodules.pnpm\@effect-ts+otel-sdk-trace-node@0.15.1@effect-ts+core@0.60.5@opentelemetry+api@1.9.0@opente_gu7sgejjhhrnegyrk5qh4aibs4\node_modules\@opentelemetry\sdk-trace-node\package.json' imported from C:\Users\HUAWEI\Desktop\next-saas-stripe-starter\nodemodules.pnpm\@effect-ts+otel-sdk-trace-node@0.15.1@effect-ts+core@0.60.5@opentelemetry+api@1.9.0@opente_gu7sgejjhhrnegyrk5qh4aibs4\nodemodules\@effect-ts\otel-sdk-trace-node_mjs\index.mjs Did you mean to import @opentelemetry+sdk-trace-node@1.25.1@opentelemetry+api@1.9.0/node_modules/@opentelemetry/sdk-trace-node/build/src/index.js? at legacyMainResolve (node:internal/modules/esm/resolve:205:26) at packageResolve (node:internal/modules/esm/resolve:831:14) at moduleResolve (node:internal/modules/esm/resolve:901:20) at defaultResolve (node:internal/modules/esm/resolve:1121:11) at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:396:12) at ModuleLoader.resolve (node:internal/modules/esm/loader:365:25) at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:240:38) at ModuleWrap.Steps I've Tried to Resolve the Issue:
@opentelemetry/sdk-trace-node
package did not have thebuild/src/index.js
file in thenode_modules
directory.@opentelemetry/sdk-trace-node
using PNPM.@opentelemetry/sdk-trace-node
to see if the issue was version-specific.node_modules
directory and reinstalled dependencies.package-lock.json
andnode_modules
and reinstalled dependencies.@opentelemetry/sdk-trace-node
.npm ci
for Clean Installation: Attempted a clean installation usingnpm ci
.Additional Information:
Debug Log Excerpt: