1

[ERROR] 22:19:26 Error: Cannot find module 'D:\Toystack\toystack-core-backend\node_modules@sentry\profiling-node\lib\sentry_cpu_profiler-win32-x64-120.node'
Require stack:

  • D:\Toystack\toystack-core-backend\node_modules@sentry\profiling-node\lib\cjs\index.js

  • D:\Toystack\toystack-core-backend\src\instrument.ts

  • D:\Toystack\toystack-core-backend\src\server.ts [INFO] 22:19:50 Restarting: D:\Toystack\toystack-core-backend\src\server.ts has been modified

    Error: Cannot find module 'D:\Toystack\toystack-core-backend\node_modules@sentry\profiling-node\lib\sentry_cpu_profiler-win32-x64-120.node' Require stack:

    • D:\Toystack\toystack-core-backend\node_modules@sentry\profiling-node\lib\cjs\index.js
    • D:\Toystack\toystack-core-backend\src\instrument.ts
    • D:\Toystack\toystack-core-backend\src\server.ts at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1142:15) at Function.Module._resolveFilename (D:\Toystack\toystack-core-backend\node_modules\module-alias\index.js:49:29) at Function.Module._load (node:internal/modules/cjs/loader:983:27) at Module.require (node:internal/modules/cjs/loader:1230:19) at require (node:internal/modules/helpers:179:18) at importCppBindingsModule (D:\Toystack\toystack-core-backend\node_modules@sentry\profiling-node\lib\cjs\index.js:166:10) at Function.Module._resolveFilename (D:\Toystack\toystack-core-backend\node_modules\module-alias\index.js:49:29) at Function.Module._load (node:internal/modules/cjs/loader:983:27) at Module.require (node:internal/modules/cjs/loader:1230:19) at require (node:internal/modules/helpers:179:18) at Function.Module._resolveFilename (D:\Toystack\toystack-core-backend\node_modules\module-alias\index.js:49:29) at Function.Module._load (node:internal/modules/cjs/loader:983:27) at Function.Module._resolveFilename (D:\Toystack\toystack-core-backend\node_modules\module-alias\index.js:49:29) at Function.Module._resolveFilename (D:\Toystack\toystack-core-backend\node_modules\module-alias\index.js:49:29) at Function.Module._load (node:internal/modules/cjs/loader:983:27) at Module.require (node:internal/modules/cjs/loader:1230:19) at require (node:internal/modules/helpers:179:18) at importCppBindingsModule (D:\Toystack\toystack-core-backend\node_modules@sentry\profiling-node\lib\cjs\index.js:166:10) at Object. (D:\Toystack\toystack-core-backend\node_modules@sentry\profiling-node\lib\cjs\index.js:169:36) at Module._compile (node:internal/modules/cjs/loader:1368:14) at Module._compile (D:\Toystack\toystack-core-backend\node_modules\source-map-support\source-map-support.js:568:25) at Module._extensions..js (node:internal/modules/cjs/loader:1426:10) at require.extensions..jsx.require.extensions..js (C:\Users\juhis\AppData\Local\Temp\ts-node-dev-hook-19581906753345146.js:114:20) at Object.nodeDevHook [as .js] (D:\Toystack\toystack-core-backend\node_modules\ts-node-dev\lib\hook.js:63:13) at Module.load (node:internal/modules/cjs/loader:1205:32) at Function.Module._load (node:internal/modules/cjs/loader:1021:12) at Module.require (node:internal/modules/cjs/loader:1230:19) at require (node:internal/modules/helpers:179:18)

I am trying to use yarn add @sentry/node and @sentry/profiling-node module but constantly it is throwing this error even after installation. and Also tried using yarn install and yarn cache clean. STill not solving. Can anyone help?

2 Answers 2

5

You are using a version of node that is too recent. See this GitHub issue.

I had the same error and it went away by downgrading node v23 to node v22.

Sign up to request clarification or add additional context in comments.

1 Comment

This worked for me. ChatGPT didn't give me the right answer!
0

In my case i used pm2 to start my server and it somehow change relative path or something like that...

Solution for such case:

provide explicitly cwd option to pm2 from config or directly in terminal, for example: pm2 start dist/main.js -- --name example --cwd /var/www/hope-it-will-help/app

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.