Closed DavidLarsKetch closed 6 years ago
process.cwd()
controllers/
routes/
cannot find module
node app.js
app.js
N/A
Running node app.js should work from any directory inside or outside the project
Context
process.cwd()
to provide filepaths forcontrollers/
&routes/
, this will causecannot find module
errors ifnode app.js
is not called from the same directory thatapp.js
is in.Associated Product Ticket
N/A
Process
process.cwd()
, look at this StackOverflow for a solution: Determine project root from a running node.js applicationExpected Result
Running
node app.js
should work from any directory inside or outside the project