0

I have been studying azure devops in the past weeek and i have been trying to deoploy my first node app on azure but i keep running on an error of build failed. and the error is Error Cannot find module './routes/hostelRoutes' so i have checked and confirmed that the module is available because everything runs on my local machine. Below is a pic where i get the error

enter image description here enter image description here

Dijiflex
  • 363
  • 3
  • 17

1 Answers1

1

According to the error message:

Error Cannot find module './routes/hostelRoutes'

The ‘node_modules’ folder could have some issues.

You could try to remove the directory ‘/node_modules/’ and re-install the folder.

Please refer to the following command line script about removing and re-installing.

cd  Project_folder
rm -rf node_modules
npm install

You could check this ticket How do I resolve “Cannot find module” error using Node.js? for some information

Kevin Lu-MSFT
  • 12,710
  • 2
  • 10
  • 19
  • 1
    Tahnks soo mucn. Acutally i realized there was a problem with my git history . the file had a conflitct before so it was not being tracked – Dijiflex May 07 '20 at 06:16