How to fix error
Tags: bcrypt, nextjs, node
Published: 2023-07-08 03:12:48

error message: error -
  [rendering]
    [root of the server]/api/user
      Error during SSR Rendering
      error rendering: Error: /Users/boscolau/Desktop/next_projects/next_auth_tut/[project]/node_modules/bcrypt/bcrypt.js (ecmascript, ssr)/package.jsondoes not exist
      
      Debug info:
      - error rendering: Error: /Users/boscolau/Desktop/next_projects/next_auth_tut/[project]/node_modules/bcrypt/bcrypt.js (ecmascript, ssr)/package.jsondoes not exist
            at push.[project]/node_modules/@mapbox/node-pre-gyp/lib/pre-binding.js (ecmascript, ssr).exports.find (node_modules/@mapbox/node-pre-gyp/lib/pre-binding.js:19:11) [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/_348ca1._.js:48888:15]
            at Object.<anonymous> (node_modules/bcrypt/bcrypt.js:5:31) [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/_348ca1._.js:58545:31]
            [at [project]/node_modules/bcrypt/bcrypt.js (ecmascript, ssr) (/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/_348ca1._.js:58716:3)]
            at /turbopack/[turbopack]/dev/runtime/base/runtime-base.ts:332:21 [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:253:27]
            at runModuleExecutionHooks (/turbopack/[turbopack]/dev/runtime/base/runtime-base.ts:381:5) [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:286:9]
            at instantiateModule (/turbopack/[turbopack]/dev/runtime/base/runtime-base.ts:331:5) [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:252:9]
            at getOrInstantiateModuleFromParent (/turbopack/[turbopack]/dev/runtime/base/runtime-base.ts:429:10) [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:313:12]
            at esmImport (/turbopack/[turbopack]/shared/runtime-utils.ts:142:18) [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:74:20]
            [at /Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/_348ca1._.js:65:116]
            [at [project]/app/api/user/route.ts (ecmascript, ssr) (/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/_348ca1._.js:82:3)]
            at /turbopack/[turbopack]/dev/runtime/base/runtime-base.ts:332:21 [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:253:27]
            at runModuleExecutionHooks (/turbopack/[turbopack]/dev/runtime/base/runtime-base.ts:381:5) [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:286:9]
            at instantiateModule (/turbopack/[turbopack]/dev/runtime/base/runtime-base.ts:331:5) [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:252:9]
            at getOrInstantiateModuleFromParent (/turbopack/[turbopack]/dev/runtime/base/runtime-base.ts:429:10) [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:313:12]
            at esmImport (/turbopack/[turbopack]/shared/runtime-utils.ts:142:18) [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:74:20]
            [at /Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_735c8c._.js:7:111]
            [at [next]/entry/app/route.ts/(ROUTE_MODULE)/[project]/node_modules/next/dist/server/future/route-modules/app-route/module.js (ecmascript)/(ENTRY)/[project]/app/api/user/route.ts (ecmascript)/(BOOTSTRAP_CONFIG)/[project]/app/api/user/route.ts/bootstrap-config.ts (ecmascript) (ecmascript, ssr) (/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_735c8c._.js:28:3)]
            at /turbopack/[turbopack]/dev/runtime/base/runtime-base.ts:332:21 [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:253:27]
            at runModuleExecutionHooks (/turbopack/[turbopack]/dev/runtime/base/runtime-base.ts:381:5) [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:286:9]
            at instantiateModule (/turbopack/[turbopack]/dev/runtime/base/runtime-base.ts:331:5) [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:252:9]
            at getOrInstantiateRuntimeModule (/turbopack/[turbopack]/dev/runtime/base/runtime-base.ts:1287:10) [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:859:12]
            at Object.registerChunk (/turbopack/[turbopack]/dev/runtime/nodejs/runtime-backend-nodejs.ts:86:11) [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:952:21]
            at registerChunk (/turbopack/[turbopack]/dev/runtime/base/runtime-base.ts:1341:18) [/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:896:20]
            [at <anonymous>]
            [at /Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:989:18]
            [at Object.<anonymous> (/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_938f7c._.js:990:3)]
            [at Module._compile (node:internal/modules/cjs/loader:1246:14)]
            [at Module._extensions..js (node:internal/modules/cjs/loader:1300:10)]
            [at Module.load (node:internal/modules/cjs/loader:1103:32)]
            [at Module._load (node:internal/modules/cjs/loader:942:12)]
            [at Module.require (node:internal/modules/cjs/loader:1127:19)]
            [at require (node:internal/modules/helpers:112:18)]
            [at Object.<anonymous> (/Users/boscolau/Desktop/next_projects/next_auth_tut/.next/server/app/chunks/ssr/[next]_entry_app_route_ts_09f1ed._.js:10:1)]
            [at Module._compile (node:internal/modules/cjs/loader:1246:14)]
            [at Module._extensions..js (node:internal/modules/cjs/loader:1300:10)]
            [at Module.load (node:internal/modules/cjs/loader:1103:32)]
            [at Module._load (node:internal/modules/cjs/loader:942:12)]
            [at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)]
            [at node:internal/main/run_main_module:23:47]

  [resolve]
    ... [3 paths] are hidden, run with --show-all to show them
warning - [parse]
  ... [7 paths] are hidden, run with --show-all to show them
POST [500] /api/user (1309ms)

How can I fix the error above?