mickasmt / next-saas-stripe-starter

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.
https://next-saas-stripe-starter.vercel.app
MIT License
1.95k stars 354 forks source link

Help Needed: Cannot Find Package `@opentelemetry/sdk-trace-node` in PNPM and NPM #39

Closed korayv closed 4 months ago

korayv commented 4 months ago

Hi everyone,

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:

  1. 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.
  2. Reinstalled the Specific Package: Attempted to reinstall @opentelemetry/sdk-trace-node using PNPM.
  3. Tried Different Versions: Installed different versions of @opentelemetry/sdk-trace-node to see if the issue was version-specific.
  4. Cleared Node Modules and Reinstalled: Deleted the node_modules directory and reinstalled dependencies.
  5. Checked for Peer Dependencies: Ensured that all peer dependencies were correctly installed and compatible.
  6. Verified Package Contents: Manually checked the contents of the package to verify the presence of the necessary files.
  7. Used Alternative Package Managers: Tried using NPM and Yarn to install dependencies.
  8. Cleared npm Cache: Cleared the npm cache to resolve potential corruption.
  9. Deleted and Recreated Lock Files: Deleted package-lock.json and node_modules and reinstalled dependencies.
  10. Reviewed Debug Logs: Reviewed npm debug logs for more detailed error information.
  11. Manually Installed Problematic Package: Tried manually installing @opentelemetry/sdk-trace-node.
  12. Used npm ci for Clean Installation: Attempted a clean installation using npm ci.
  13. Ensured Latest npm Version: Upgraded to the latest npm version.

Additional Information:

Debug Log Excerpt:

mickasmt commented 4 months ago

Hi @korayv, I think it's the same error as this closed issue #28.

korayv commented 4 months ago

Worked! Thank you