Can’t find the module

Asked

Viewed 218 times

-1

That mistake you’re making, I’m following a course and the teacher’s wheel, mine gives that mistake!

C:\Program Files\nodejs\node.exe --inspect-brk=34110 build\server.js
Debugger listening on ws://127.0.0.1:34110/763e1f04-c0a0-42ad-bcd5-b55004766705
For help, see: https://nodejs.org/en/docs/inspector
Debugger attached.
Waiting for the debugger to disconnect...
Error: Cannot find module '../env/${process.env.NODE_ENV}.env.js'
Require stack:
C:\Users\Tecnoresolve\Desktop\typescript-course\build\config\env\config.js
- C:\Users\Tecnoresolve\Desktop\typescript-course\build\server.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15)
    at Function.Module._load (internal/modules/cjs/loader.js:864:27)
    at Module.require (internal/modules/cjs/loader.js:1044:19)
    at require (internal/modules/cjs/helpers.js:77:18)
    at module.exports (c:\Users\Tecnoresolve\Desktop\typescript-course\server\config\env\config.ts:4:24)
at Object.<anonymous> (c:\Users\Tecnoresolve\Desktop\typescript-course\server\server.ts:7:46)
    at Module._compile (internal/modules/cjs/loader.js:1155:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
    at Module.load (internal/modules/cjs/loader.js:1002:32)
    at Function.Module._load (internal/modules/cjs/loader.js:901:14)

1 answer

0

The module located in C:\Users\Tecnoresolve\Desktop\typescript-course\build\config\env\config.js is trying to include the module ../env/${process.env.NODE_ENV}.env.js, but this path does not exist. Try running the console command node -e "console.log(process.env.NODE_ENV)". If it is undefined, look in the folder C:\Users\Tecnoresolve\Desktop\typescript-course\build\config\env by some file that ends with .env.js and replace the string ../env/${process.env.NODE_ENV}.env.js by the way of that file.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.